import { Text, Paragraph, Strong, Italic, Underline, Strikethrough } from "@sugarcoat/ui-nxt";<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.
Paragraph Component#
Block-level text that renders as a <p> element.
Strong (Bold)#
Bold text that renders as a <strong> element.
Italic (Emphasis)#
Italic text that renders as an <em> element.
Underline#
Underlined text that renders as a <u> element.
Strikethrough#
Strikethrough text that renders as a <del> element.
Sizes#
Control the font size with the size prop. Available sizes are 1-12, normal, or inherit.
Weights#
Control the font weight with the weight prop.
Centered Text#
Center align text with the center prop.
Gradient Text#
Apply gradient effects to text (requires additional CSS setup).
Combining Styles#
Combine multiple text components for rich formatting.
Polymorphic Rendering#
Use the as prop to render as different HTML elements.
Props#
All typography components share these props:
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "1"-"12" | "normal" | "inherit" | "normal" | Font size |
| weight | "1"-"9" | "normal" | "bold" | "inherit" | "normal" | Font weight |
| center | boolean | false | Center align the text |
| gradient | boolean | false | Enable gradient text effect |
| as | ElementType | varies | HTML element to render as |
| css | SystemStyleObject | - | Additional Panda CSS styles |
Component Defaults#
| Component | Default Element | Default Weight |
|---|---|---|
Text | <span> | normal |
Paragraph | <p> | normal |
Strong | <strong> | bold |
Italic | <em> | normal |
Underline | <u> | normal |
Strikethrough | <del> | normal |