Typography

A collection of text components for paragraphs, spans, and inline text formatting with consistent styling.

Import
import { Text, Paragraph, Strong, Italic, Underline, Strikethrough } from "@sugarcoat/ui-nxt";
Usage
<Paragraph>This is a paragraph of text.</Paragraph>
<Text>Inline text</Text>
<Strong>Bold text</Strong>

Text Component#

The base inline text component that renders as a <span> by default.

Basic Text

Paragraph Component#

Block-level text that renders as a <p> element.

Paragraph

Strong (Bold)#

Bold text that renders as a <strong> element.

Strong

Italic (Emphasis)#

Italic text that renders as an <em> element.

Italic

Underline#

Underlined text that renders as a <u> element.

Underline

Strikethrough#

Strikethrough text that renders as a <del> element.

Strikethrough

Sizes#

Control the font size with the size prop. Available sizes are 1-12, normal, or inherit.

Size 1 (Smallest)
Size 3
Size 5
Size 7
Size 9

Weights#

Control the font weight with the weight prop.

Normal Weight
Bold Weight
Numeric Weights

Centered Text#

Center align text with the center prop.

Centered

Gradient Text#

Apply gradient effects to text (requires additional CSS setup).

Gradient

Combining Styles#

Combine multiple text components for rich formatting.

Combined Styles

Polymorphic Rendering#

Use the as prop to render as different HTML elements.

As Different Elements

Props#

All typography components share these props:

PropTypeDefaultDescription
size"1"-"12" | "normal" | "inherit""normal"Font size
weight"1"-"9" | "normal" | "bold" | "inherit""normal"Font weight
centerbooleanfalseCenter align the text
gradientbooleanfalseEnable gradient text effect
asElementTypevariesHTML element to render as
cssSystemStyleObject-Additional Panda CSS styles

Component Defaults#

ComponentDefault ElementDefault Weight
Text<span>normal
Paragraph<p>normal
Strong<strong>bold
Italic<em>normal
Underline<u>normal
Strikethrough<del>normal
Customize Theme
Build your own sugarcoat/ui theme
PresetLime / Violet / Slate
Brand ColorLime
Accent ColorViolet
Gray ScaleSlate
Border RadiusLg