Skip to content
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

Reference the Navius.Primitives package for the headless primitive, or vendor a styled version with the CLI: navius add copies the styled zits/ui component plus the brain files it depends on.

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

Implements the role and semantics of the separator WAI-ARIA APG pattern. Covered by the browser test suite and an axe-core WCAG gate in CI.

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.