Separator

View as Markdown

A line between groups, across or down, with a word in it such as or, a day or New.

When to use

A line between groups, across or down, with a word in it such as or, a day or New. Use Form Layout instead when you are laying out a form's sections.

Usage

import { Separator } from "./ui/uicontext/components/Separator.ts"
export const Or = <M>(h: Html.H<M>) => Separator(h, { label: "or" })

Examples

Days and unread in a thread

align: "start" and tone: "accent" for a New line. A decorative vertical one only draws.

PriyaPushed the pricing page copy. Can someone check the annual toggle?

KenjiLooks right on mobile. Merging after lunch.

AdaMerged. Deploy is going out now.

TomasAnnual prices show monthly in the receipt email.

PriyaOn it.

12 replies
3 people
Last reply 4 min ago

API reference

Options

Separator options
NameTypeDefaultDescription
orientation"horizontal" | "vertical"——
labelstring—Words on the line: "or", "Today", "New".
align"center" | "start"centerWhere the words sit; center by default.
tone"accent"—The line in the danger color, for "New" above unread messages.
spacedboolean—Room above and below (or beside, when vertical).
decorativeboolean—Only draws a line: no role for a screen reader.
styleStyle——

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/separator

Source