Search docs

Separator

A line that separates content.

There is no WAI-ARIA APG pattern for static separators. Separator renders a <div> with the separator role, because <hr> cannot express a vertical orientation.

leve-ui

Headless UI for Qwik.

import { component$, useStyles$ } from '@builder.io/qwik';
import { Separator } from '@leve-ui/separator';
import styles from './default.css?inline';

export default component$(() => {
  useStyles$(styles);

  return (
    <div class="separator-default-card">
      <p class="separator-default-title">leve-ui</p>
      <p class="separator-default-text">Headless UI for Qwik.</p>
      <Separator.Root class="separator-default" />
      <div class="separator-default-links">
        <span>Docs</span>
        <span>GitHub</span>
        <span>npm</span>
      </div>
    </div>
  );
});

Installation#

Install the individual package, or use @leve-ui/core to get every component at once:

pnpm add @leve-ui/separator

Anatomy#

import { Separator } from '@leve-ui/separator'; // or '@leve-ui/core'

<Separator.Root />
PartElementDescription
Separator.Root<div>The separator. Has no children.

Examples#

Decorative#

decorative hides a purely visual separator from assistive technologies with role="none".

leve-ui

Headless UI for Qwik.

Vertical#

orientation="vertical" separates items in a row.

DocsGitHub

API Reference#

Root#

PropDefaultType
orientation'horizontal''horizontal' | 'vertical'

The orientation of the separator.

decorativefalseboolean

Hides the separator from assistive technology (role="none"). Set to true when the separator is purely visual.

Also accepts all <div> attributes.

Data attributeValue
data-leve-separatorAlways present
data-orientation"horizontal" | "vertical"

data-orientation is rendered even when decorative is set, so the same styles work for both.

Accessibility#

  • Separator.Root renders role="separator", and aria-orientation="vertical" when vertical. Horizontal is the default of the role, so aria-orientation is not rendered for it.
  • With decorative, it renders role="none" and no aria-orientation. Use it when the separator does not divide meaningful sections.
  • Separator is not focusable and has no keyboard interaction.