shadcn.io is not affiliated with official shadcn/ui
Separator examples · Styled
Gradient Separator for React
A horizontal separator that fades in and out through the border color.
Soften the edges of a rule. This React Separator replaces its solid fill with a gradient from transparent, through the border color, back to transparent: bg-transparent clears the fill and bg-linear-to-r from-transparent via-border to-transparent paints the fade. Use it for landing page bands and any break where a hard edge feels too sharp.
Preview
Installation
FAQ
When should I use a gradient separator?
On landing or editorial pages where a hard line feels heavy. Keep a solid line in app chrome and forms so the structure stays unambiguous.
Why still use the Separator component?
You keep the same orientation handling, data-slot and accessible role as every other separator. A plain div with a gradient would need those added by hand.
How do I change the gradient colors?
Swap via-border for via-primary or via-foreground/20. Keep both ends transparent so the fade still reads as a line, not a bar.
Should the gradient span the full width?
Full width is the default and matches solid separators. For a shorter accent, constrain it with max-w-md and center it with mx-auto, plus the width override from the Inset Separator example.
Related
- Horizontal SeparatorA horizontal separator that divides a
- Thick SeparatorA 4 pixel horizontal separator for major
- Dashed SeparatorA dashed horizontal separator drawn with
- Dotted SeparatorA dotted horizontal separator drawn with
- Standard CardA basic card with a title, a description
- Section Divider SeparatorA horizontal separator between two titled