Separator

@sushindustries/ui

A rule with two directions and an accessibility decision: announced when it separates content, silent when it is furniture.

4 min read
View as MarkdownEdit on GitHub

Props

PropTypeDefaultDoes
orientation?"horizontal" | "vertical""horizontal"Vertical needs a height from its container; horizontal is the default.
decorative?booleanfalsePurely visual dividers should not be announced.

Notes

decorative changes which element renders, not just an ARIA attribute on the same one - true produces a <span aria-hidden="true">, false produces a real <hr>. There's no in-between where an <hr> is hidden from screen readers or a <span> is announced; pick the element by picking the prop.

orientation="vertical" depends entirely on its container providing a height, as covered in Guides - the prop only writes the attribute the stylesheet reads.