Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Code Block
- Collapsible
- Combobox
- Command
- Context Menu
- Copy Button
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Form
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Page Header
- Pagination
- Panel
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Section Header
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Stat
- Stat Card
- Switch
- Table
- Tabs
- Textarea
- Theme Toggle
- Toggle
- Toggle Group
- Tooltip
- Typography
Section Header
A section heading with an index, title, and meta line.
01
12 itemsFeatured
01
Installation
Add the section header component with the shadcn CLI.
bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/section-header.json02
Usage
tsx
import { SectionHeader } from "@/components/ui/section-header"03
Examples
Title only
Index and meta are optionalComponents
import {
SectionHeader,
SectionHeaderContent,
SectionHeaderTitle,
} from "@/components/ui/section-header"
<SectionHeader>
<SectionHeaderContent>
<SectionHeaderTitle>Components</SectionHeaderTitle>
</SectionHeaderContent>
</SectionHeader>With index
Numbered section heading02
Installation
import {
SectionHeader,
SectionHeaderContent,
SectionHeaderIndex,
SectionHeaderTitle,
} from "@/components/ui/section-header"
<SectionHeader>
<SectionHeaderContent>
<SectionHeaderIndex>02</SectionHeaderIndex>
<SectionHeaderTitle>Installation</SectionHeaderTitle>
</SectionHeaderContent>
</SectionHeader>With meta
Trailing metadata on the rightRecent activity
import {
SectionHeader,
SectionHeaderContent,
SectionHeaderMeta,
SectionHeaderTitle,
} from "@/components/ui/section-header"
<SectionHeader>
<SectionHeaderContent>
<SectionHeaderTitle>Recent activity</SectionHeaderTitle>
</SectionHeaderContent>
<SectionHeaderMeta>Updated 2h ago</SectionHeaderMeta>
</SectionHeader>With action
Place any control in the trailing slot03
Members
import { Button } from "@/components/ui/button"
import {
SectionHeader,
SectionHeaderContent,
SectionHeaderIndex,
SectionHeaderTitle,
} from "@/components/ui/section-header"
<SectionHeader>
<SectionHeaderContent>
<SectionHeaderIndex>03</SectionHeaderIndex>
<SectionHeaderTitle>Members</SectionHeaderTitle>
</SectionHeaderContent>
<Button size="sm" variant="outline">Invite</Button>
</SectionHeader>Section
Heading above its content01
3 itemsOverview
Section content sits directly beneath the header.
import {
SectionHeader,
SectionHeaderContent,
SectionHeaderIndex,
SectionHeaderMeta,
SectionHeaderTitle,
} from "@/components/ui/section-header"
<section className="flex flex-col gap-4">
<SectionHeader>
<SectionHeaderContent>
<SectionHeaderIndex>01</SectionHeaderIndex>
<SectionHeaderTitle>Overview</SectionHeaderTitle>
</SectionHeaderContent>
<SectionHeaderMeta>3 items</SectionHeaderMeta>
</SectionHeader>
<p className="text-pretty text-muted-foreground">
Section content sits directly beneath the header.
</p>
</section>