HextaUI

Separator: Decorative

decorative hides a purely visual line from screen readers, so they don't announce a separator between rows that already read well on their own.

Subtotal$48.00
Shipping$4.00
Total$52.00
import { Separator } from "@/components/ui/separator"

export function SeparatorDecorative() {
  return (
    <div className="flex w-full max-w-xs flex-col gap-3 rounded-xl border p-4 text-sm">
      <div className="flex items-center justify-between">
        <span className="text-muted-foreground">Subtotal</span>
        <span className="tabular-nums">$48.00</span>
      </div>
      <div className="flex items-center justify-between">
        <span className="text-muted-foreground">Shipping</span>
        <span className="tabular-nums">$4.00</span>
      </div>
      <Separator decorative />
      <div className="flex items-center justify-between font-medium">
        <span>Total</span>
        <span className="tabular-nums">$52.00</span>
      </div>
    </div>
  )
}

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

pnpm dlx shadcn@latest add https://hextaui.com/r/separator-decorative.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
decorativeHide the line from screen readers when it is only visual.
booleanfalse

Every prop is in the Separator API reference.

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