Skip to content

Components · Layout

Separator

Horizontal or vertical divider.

@rookcom/monarch-reactComponent

Horizontal

Profile

Security

Usage examples

The example at the top of the page is the only one for this component.

Purpose

A thin visual divider between groups of content.

Use when

  • Separating groups inside a toolbar, menu or panel.

Avoid when

  • Separating page sections that need headings: use headings and spacing.

Design principles

  • Decorative by default; set decorative={false} only when the division is meaningful to screen-reader users.

API reference

import { Separator } from '@rookcom/monarch-react';
ExportKindRenderingRoot class
Separatorcomponentserver-safe.mn-separator

Built on @radix-ui/react-separator; the ref is forwarded.

Generated from the TypeScript declarations of packages/react/src/components/layout/separator.

Properties

Separator

Visual divider. `decorative` (default) hides it from assistive technology.

PropTypeDescription
asChildboolean
childrenReactNode
classNamestring
idstring

Variants

PropValuesDescription
orientation'horizontal''vertical'Default horizontal. Exposed as data-orientation.
decorative'true''false'Default true (no separator role).

States

StateExposed asBehaviour
Static–No interactive states.

Interaction behaviour

  • None.

Keyboard support

Not interactive, so there is no keyboard behaviour.

Accessibility

Role
none when decorative; separator otherwise
Accessible name
–
  • Decorative separators are hidden from assistive technology (Radix).

Responsive behaviour

  • Horizontal separators fill the width; vertical ones fill the height of their container.

Theme support

  • Colour is a Monarch border token.

Do and don't

Do

  • Keep separators decorative unless the grouping matters to screen-reader users.

Don't

  • Do not stack separators to create spacing.
  • Toolbar: Groups controls; separators can divide its groups.

Dependencies

KindDepends on
npm packages@radix-ui/react-separatorreact
Monarch componentsNone

Testing coverage

  • Is decorative by default and a separator when decorative={false}.
CheckCovered
Axe in jsdomYes
Server renderingYes
Browser suitesNone yet

Tests: packages/react/src/components/layout/separator