HextaUI

Separator: Align

align moves the label to the start or end, which suits section and date headers. Icons are sized to the text.

Today
Yesterday
Last week
import { IconCalendar } from "@tabler/icons-react"

import { Separator } from "@/components/ui/separator"

export function SeparatorAlign() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-6">
      <Separator align="start">
        <IconCalendar aria-hidden="true" />
        Today
      </Separator>
      <Separator>Yesterday</Separator>
      <Separator align="end">Last week</Separator>
    </div>
  )
}

This adds the example as components/examples/separator/align.tsx, together with the Separator component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/separator-align.json

To add only the component, follow the Separator installation.

Props in this example

The Separator props this example sets, from the API reference.

PropTypeDefault
alignWhere the label sits along the line.
"start" | "center" | "end""center"

Every prop is in the Separator API reference.

See them all, with keyboard support and accessibility notes, on the Separator page.