Separator

A 1 px hairline inside cards.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/separator.json

Inside a card

1 px --border, horizontal (full width) or vertical (full height). Structural lines stay 1 px or thinner.

RekeningBCA •••• 4521
Status PTKPK/0
Bergabung4 Jan 2024
Masa kerja2 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

DoHairlines inside, shadow outsideRows split with a 1 px --border; the card itself keeps shadow-card.
Don'tA 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.

terminal
bunx --bun shadcn@latest add https://mahrdesign.faizintifada.com/r/separator.json

API

import { Separator } from "@/components/ui/separator"
PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Vertical stretches to the parent height.
classNamestring–Spacing only (mx, my). Never change the colour or thickness.