- Components
- text
Text
Semantic text component with intent-based styling.
Demo
Default muted text
Body text for paragraphs
Title text for emphasis
import { Text } from "@/components/jk/text"
export const TextDemo = () => {
return (
<div className="space-y-2">
<Text>Default muted text</Text>
<Text intent="body">Body text for paragraphs</Text>
<Text intent="title">Title text for emphasis</Text>
</div>
)
}
Installation
terminal
npx shadcn@latest add @jk-ui/textUsage
The Text component provides semantic text styling with intent-based coloring. Use the
intent prop to apply different text colors, and elementType to change the HTML tag.Examples
Intents
Muted text for secondary information
Body text for main content
Title text for headings context
Caption text in grayPrimary colored text
Secondary colored text
Warning colored text
Danger colored text
import { Text } from "@/components/jk/text"
export const TextIntents = () => {
return (
<div className="space-y-2">
<Text intent="muted">Muted text for secondary information</Text>
<Text intent="body">Body text for main content</Text>
<Text intent="title">Title text for headings context</Text>
<Text intent="caption" elementType="span">Caption text in gray</Text>
<Text intent="primary">Primary colored text</Text>
<Text intent="secondary">Secondary colored text</Text>
<Text intent="warning">Warning colored text</Text>
<Text intent="danger">Danger colored text</Text>
</div>
)
}
API
| Prop | Type | Description |
|---|---|---|
| intent | muted | body | title | caption | primary | secondary | warning | danger | Semantic color intent for the text. |
| elementType | p | span | div | label | small | HTML tag to render (default: p). |