Text#

Typography components for consistent text styling without manual CSS classes.

Import#

TSX
import { Text, Heading } from '@sigx/daisyui';

Basic Usage#

The Text component provides consistent text styling with props instead of classes.

TSX
Loading preview...

Heading Component#

Use Heading for semantic heading elements with consistent styling.

TSX
Loading preview...

Block Text (Paragraphs)#

Use as="p" to render block-level text content.

TSX
Loading preview...

Text Sizes#

Available size options from extra small to 5xl.

TSX
Loading preview...

Colors#

Use semantic colors for consistent theming.

TSX
Loading preview...

Font Weight#

Control text weight with the weight prop.

TSX
Loading preview...

Text Alignment#

Control text alignment with the align prop.

TSX
Loading preview...

Text Decoration#

Add italic, underline, strikethrough, or uppercase styling.

TSX
Loading preview...

Truncation#

Truncate overflowing text with an ellipsis.

TSX
Loading preview...

Custom Element (as prop)#

Render as a different element using the as prop.

TSX
Loading preview...

With Margin#

Add spacing with the margin prop.

TSX
Loading preview...

Heading Sizes#

Headings have default sizes based on level, but can be customized.

TSX
Loading preview...

Practical Examples#

Card with Typography#

TSX
Loading preview...

Status Message#

TSX
Loading preview...

Props#

Text Props#

PropTypeDefaultDescription
as'span' | 'p' | 'label' | 'strong' | 'em' | 'small' | 'div''span'HTML element to render
size'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl'-Font size
weight'light' | 'normal' | 'medium' | 'semibold' | 'bold'-Font weight
colorTextColor-Text color (see colors above)
align'left' | 'center' | 'right' | 'justify'-Text alignment
italicbooleanfalseItalic style
underlinebooleanfalseUnderline decoration
strikethroughbooleanfalseStrikethrough decoration
uppercasebooleanfalseUppercase transform
truncateboolean | number-Truncate with ellipsis. true = single line, number = max lines
marginSpacingValue | SpacingObject-Margin around text
classstring-Additional CSS classes

Heading Props#

Same as Text props, plus:

PropTypeDefaultDescription
level1 | 2 | 3 | 4 | 5 | 62Heading level (renders h1-h6)

Default sizes by level: h1=4xl, h2=3xl, h3=2xl, h4=xl, h5=lg, h6=base

TextColor#

TSX
'base' | 'muted' | 'faint' |
'primary' | 'primary-content' |
'secondary' | 'secondary-content' |
'accent' | 'accent-content' |
'neutral' | 'neutral-content' |
'info' | 'info-content' |
'success' | 'success-content' |
'warning' | 'warning-content' |
'error' | 'error-content'