Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Separator examples · With Text

With Text Right Separator for React

A separator running to a More link at the end of the row, for a section that continues elsewhere.

Framework
UI library

End the row with the action. A Separator with flex-1 fills the row up to a More link at the end, so the line points at what comes next. Use it for View all, Show more and section footers.

Preview

Preview width

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

How does More end up at the end?

The Separator with flex-1 comes first, then an a with shrink-0. The row is flex items-center gap-2, so the line fills the start and the link sits at the end.

Why does the line use flex-1?

Separator includes shrink-0. flex-1 is merged after that class, and cn() keeps flex-1, which sets shrink too. The link's shrink-0 keeps More at its own width.

How is the link styled at rest?

The anchor uses text-xs and text-muted-foreground. shrink-0 keeps the word from shrinking when the row gets narrow.

Can I focus More from the keyboard?

Yes. It is an anchor with an href, so Tab stops on it and Enter follows it. The separator does not take focus.

Are the lines announced with Base UI?

The words beside the line are what people need to hear. The line is exposed to assistive tech. A border is quieter when the line is only visual.