Divider

A line between things, across or up, with an optional word in the middle.

Divider

Plain Blade, pure CSS. No Alpine needed.

Use it

<x-ds::divider />

<x-ds::divider label="or" />

<div class="flex items-center gap-3">
    <x-ds::button variant="ghost" size="sm">Bold</x-ds::button>
    <x-ds::divider orientation="vertical" :decorative="false" />
    <x-ds::button variant="ghost" size="sm">Link</x-ds::button>
</div>

Props

PropDefaultWhat it does
orientationhorizontalvertical stretches to the height of the flex row it is in.
label—A word in the middle, read as text.
decorativetrueHidden from screen readers. false when the line marks a change of group (a menu, a toolbar): then it is role="separator".

Other attributes go on the root: class="my-6" for the space around it.

Accessibility

  • Hidden from screen readers unless it means something; then a separator.
  • A labelled divider is read as its word.

Don't

  • Don't announce every line. Leave decorative alone unless the line separates groups.

More in specs/divider.md.


From the package repo: edit this page on GitHub.

Was this page helpful?