- Components
- heading
Heading
Semantic heading levels with consistent sizing and color intents.
Demo
Heading Level 1
Heading Level 2
Heading Level 3
import { Heading } from "@/components/jk/heading"
export const HeadingDemo = () => {
return (
<div className="space-y-4">
<Heading level={1}>Heading Level 1</Heading>
<Heading level={2}>Heading Level 2</Heading>
<Heading level={3}>Heading Level 3</Heading>
</div>
)
}
Installation
terminal
npx shadcn@latest add @jk-ui/headingUsage
The Heading component provides semantic heading levels (H1-H5) with consistent sizing. Use the
level prop to set the heading level, and intent for color styling.Examples
Levels
H1 - Page Title
H2 - Section Title
H3 - Subsection
H4 - Card Title
H5 - Small Heading
import { Heading } from "@/components/jk/heading"
export const HeadingLevels = () => {
return (
<div className="space-y-4">
<Heading level={1}>H1 - Page Title</Heading>
<Heading level={2}>H2 - Section Title</Heading>
<Heading level={3}>H3 - Subsection</Heading>
<Heading level={4}>H4 - Card Title</Heading>
<Heading level={5}>H5 - Small Heading</Heading>
</div>
)
}
Intents
Title intent (default)
Body intent
Muted intent
Primary intent
Secondary intent
Danger intent
Warning intent
import { Heading } from "@/components/jk/heading"
export const HeadingIntents = () => {
return (
<div className="space-y-4">
<Heading level={3} intent="title">Title intent (default)</Heading>
<Heading level={3} intent="body">Body intent</Heading>
<Heading level={3} intent="muted">Muted intent</Heading>
<Heading level={3} intent="primary">Primary intent</Heading>
<Heading level={3} intent="secondary">Secondary intent</Heading>
<Heading level={3} intent="danger">Danger intent</Heading>
<Heading level={3} intent="warning">Warning intent</Heading>
</div>
)
}
API
| Prop | Type | Description |
|---|---|---|
| level | 1 | 2 | 3 | 4 | 5 | Heading level determining the HTML tag (h1-h5) and size. |
| intent | title | body | muted | primary | secondary | danger | warning | Semantic color intent for the heading. |