Separator
A 1 px hairline inside cards.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/separator.jsonInside a card
RekeningBCA •••• 4521
Status PTKPK/0
4 Jan 2024
2 tahun
When to use
- Between rows inside a card (key-value rows, list rows).
- Between the header, body and footer of a card or sheet.
- Between the cells of a facts strip (vertical).
When not to use
- Around a card → nothing: the card's edge is its shadow.
- Between sections of a page → space (24–32), not a line.
- Between row groups → CardGroupHeader strip.
Do and don't
Hairlines inside, shadow outsideRows split with a 1 px --border; the card itself keeps shadow-card.
A border box around a cardRing + border = a double edge. Never put a Separator or a border around a card.
Installation
Add Separator with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.
API
import { Separator } from "@/components/ui/separator"| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | Vertical stretches to the parent height. |
className | string | – | Spacing only (mx, my). Never change the colour or thickness. |