Skip to content

Separator

Download .md

A separator draws a thin line between groups of content, such as the sections of a card or a menu.

  • Use it between groups that belong together but read separately, such as the profile and the stats of an artist card.
  • Prefer spacing first; add a line only when spacing alone doesn’t show the groups.
  • Use vertical between items in a row, such as toolbar buttons.
React

Rara Senandika

Penyanyi pop, Bandung

3 rilis · 12.480 pendengar bulanan

Vue

Rara Senandika

Penyanyi pop, Bandung

3 rilis · 12.480 pendengar bulanan

12
  1. 1Horizontal separator
  2. 2Vertical separator

A 1px line on border, horizontal by default.

Orientation Use it for
horizontal (default) Between stacked groups.
vertical Between items in a row.
React Vue Flutter Type Default Use
orientation orientation ShadSeparator.horizontal / .vertical text horizontal The direction of the line.
always role="separator" decorative not announced boolean true in Vue Whether screen readers hear it.
import { Separator } from "@/components/ui/separator"
export default function SeparatorDemo() {
return (
<div className="w-full max-w-xs rounded-lg border border-border bg-card p-4 text-sm">
<p className="font-medium">Rara Senandika</p>
<p className="text-muted-foreground">Penyanyi pop, Bandung</p>
<Separator className="my-3" />
<p className="text-muted-foreground">3 rilis · 12.480 pendengar bulanan</p>
</div>
)
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/separator.json
  • A separator between real sections has role="separator"; a line that is only decoration is hidden from screen readers (decorative in Vue).
  • It never takes the focus.