Text

Text is a flexible component for rendering inline or block text with customizable color, size, alignment, font, and weight. It supports both prop and boolean flag APIs for maximum convenience and Tailwind compatibility.

Text

The Text component renders flexible inline or block text. It supports color, size, alignment, font, weight, and case props, with both prop and boolean flag APIs for convenience.

Text Props Type Description
is
string

Render as a different HTML element (e.g., 'span', 'div', 'h1').

join
boolean

Adds the join-item class for grouping text.

block
boolean

Applies block display.

inline
boolean

Applies inline display.

inlineBlock
boolean

Applies inline-block display.

label
boolean

Applies label class. This is typically used within Label with an input prop.

color
string

Sets the text color. Options: - neutral, primary, secondary, accent, info, success, warning, error - neutral-content, primary-content, secondary-content, accent-content, info-content, success-content, warning-content, error-content

   
neutral
boolean

sets color to neutral

   
primary
boolean

sets color to primary

   
secondary
boolean

sets color to accent

   
info
boolean

sets color to info

   
success
boolean

sets color to success

   
warning
boolean

sets color to warning

   
error
boolean

sets color to error

   
neutralContent
boolean

sets color to neutral-content

   
primaryContent
boolean

sets color to primary-content

   
secondaryContent
boolean

sets color to secondary-content

   
accentContent
boolean

sets color to accent-content

   
infoContent
boolean

sets color to info-content

   
successContent
boolean

sets color to success-content

   
warningContent
boolean

sets color to warning-content

   
errorContent
boolean

sets color to error-content

size
string

Sets the text size. Options: - 9xl, 8xl, 7xl, 6xl, 5xl, 4xl, 3xl, 2xl, xl, lg, md, sm, xs

   
xl
boolean

sets size to xl

   
lg
boolean

sets size to md

   
sm
boolean

sets size to sm

   
xs
boolean

sets size to xs

align
string

Sets the text alignment. Options: left, center, right, justify.

   
left
boolean

sets alignment to left

   
center
boolean

sets alignment to center

   
right
boolean

sets alignment to right

   
justify
boolean

sets alignment to justify

case
string

Sets the text transform. Options: upper, lower, capitalize, normal.

   
uppercase
boolean

sets case to uppercase

   
lowercase
boolean

sets case to lowercase

   
capitalize
boolean

sets case to capitalize

   
normalCase
boolean

sets case to normal

font
string

Sets the font family. Options: sans, serif, mono.

   
sans
boolean

sets font to sans

   
serif
boolean

sets font to serif

   
mono
boolean

sets font to mono

weight
string

Sets the font weight. Options: thin, extralight, light, normal, medium, semibold, bold, extrabold, black.

   
thin
boolean

sets weight to thin

   
extralight
boolean

sets weight to extralight

   
light
boolean

sets weight to light

   
normal
boolean

sets weight to normal

   
medium
boolean

sets weight to medium

   
semibold
boolean

sets weight to semibold

   
bold
boolean

sets weight to bold

   
extrabold
boolean

sets weight to extrabold

   
black
boolean

sets weight to black

Text Slots Description
default

The default slot. Place text content here.

Examples

Colors

Text color variants using semantic color props or boolean flags.

neutral primary secondary accent info success warning error
Code Example
Color.vue

Sizes

Text size variants using the size prop or boolean flags.

xs sm md lg xl 2xl 3xl 4xl 5xl 6xl 7xl 8xl 9xl
Code Example
Size.vue

Alignment

Text alignment using the align prop or boolean flags.

left
center
right
justify: Radio telescope hundreds of thousands rich in mystery are creatures of the cosmos tingling of the spine Vangelis? The ash of stellar alchemy circumnavigated star stuff harvesting star light Sea of Tranquility something incredible is waiting to be known two ghostly white figures in coveralls and helmets are softly dancing. Rich in heavy atoms courage of our questions astonishment permanence of the stars permanence of the stars a still more glorious dawn awaits and billions upon billions upon billions upon billions upon billions upon billions upon billions.
Code Example
Align.vue

Font Family

Font family options using the font prop or boolean flags.

sans serif mono
Code Example
Font.vue

Weight

Font weight options using the weight prop or boolean flags.

thin extralight light normal medium semibold bold extrabold black
Code Example
Weight.vue

Case

Text transform options using the case prop or boolean flags.

uppercase this text lowercase this text capitalize this text normal-case this text
Code Example
Case.vue

Custom Element

Render text as a different tag using the is prop.

Code Example
Tag.vue