1. Components
  2. 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/text

Usage

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 gray

Primary 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

PropTypeDescription
intentmuted | body | title | caption | primary | secondary | warning | dangerSemantic color intent for the text.
elementTypep | span | div | label | smallHTML tag to render (default: p).