Skip to content

Text

vue
<script setup lang="ts">
import { Text } from '@/components/kuro/text';
</script>

<template>
  <Text variant="primary" size="lg" as="h2"> Hello world </Text>
</template>

Installation

bash
npx kuro-ui add text
bash
npx github:Bartek-Nowak/Kuro add text

Description

The Text component provides a consistent way to apply typography styles throughout your app. You can customize the tone using the variant prop, control size with the size prop, and change the HTML tag using the as prop.

It’s useful for ensuring all text elements across your project share a unified style system.

Variants and Sizes

Variants

VariantDescription
defaultNeutral, standard foreground text
primaryBlue, used for emphasis
secondaryDark gray, for secondary text
mutedLight gray, de-emphasized text
destructiveRed, used for errors or warnings
successGreen, used for confirmation or success
warningYellow, used for warnings or cautions
infoCyan, used for informative messages

Sizes

SizeDescription
smSmall text
mdMedium text (default)
lgLarge text
xlExtra large text
2xl2× extra large text

Props

PropTypeDescription
variantstringVisual tone (default, primary, muted, success, etc.)
sizestringText size (sm, md, lg, etc.)
asstringHTML tag to render (p, span, h1, etc.) – default is p
classstringAdditional Tailwind classes to apply

Slots

SlotDescription
defaultContent of the text

Usage Example

vue
<Text>This is default text.</Text>

<Text as="h1" variant="primary" size="2xl">Main Heading</Text>

<Text variant="destructive" size="sm">Something went wrong.</Text>