navius

Separator

Visually or semantically separates content.

Navius Primitives

An open-source UI component library.

Blog
Docs
Source

Features

  • Supports horizontal and vertical orientations.
  • Exposes data-orientation for orientation-aware styling.
  • Renders role="separator" with the correct aria-orientation.
  • Can be marked Decorative to drop semantics for purely visual dividers.

Installation

Install the brain, or copy just this primitive in with the CLI.

Anatomy

Import the part and assemble it.

API Reference

The separator. Renders a div.

Prop Type Default
Orientation string "horizontal"
Decorative bool false
ChildContent RenderFragment? -
Data attribute Values
[data-orientation] "horizontal" | "vertical"
[data-navius-separator] Present on every separator

Accessibility

Adheres to the separator WAI-ARIA design pattern.

A separator is a non-focusable static divider, so it has no keyboard interactions. The non-decorative separator carries role="separator"; a vertical separator also exposes aria-orientation="vertical" (the horizontal orientation is the ARIA default and is omitted). Set Decorative when the rule is purely visual to remove it from the accessibility tree.