Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Separator examples · Styled

Dotted Separator for React

A dotted horizontal separator drawn with a top border on a transparent line.

Framework
UI library

Use the lightest rule. This React Separator draws a dotted top border, drops its fill with bg-transparent and sets its own height to zero, so only the dots show. Use it for receipt-style totals, minor breaks and decorative pauses.

Preview

Preview width

Subtotal

Total due

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

When should I use a dotted separator?

When the break should almost disappear: between a subtotal and a total, as here, or in minor subsections. Use a solid line for anything structural.

What is the difference between dotted and dashed?

Dots are round and lighter; dashes are longer and a bit heavier. Both are drawn with a border, not a background.

Can I control dot size?

Not with border-dotted, since the browser draws the dots. Use an SVG or a repeating radial gradient for a custom size or spacing.

How do I change the dot color?

Use a border color utility such as border-primary or border-muted-foreground. The fill is transparent, so bg-* classes won't tint the dots.

Are dotted separators accessible?

They're exposed like any other Separator, but they're the hardest style to see. Don't rely on dots as the only boundary between important sections.

How do dotted separators print?

Often faintly. Prefer a solid line in print for anything that must stay visible.