Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Layout & primitives

Divider

Free1.0 KB gzipped

A line that separates content, horizontally or vertically, with an optional inline label.

Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · No keyboard interaction of its own · Full report

Import

tsx
import { Divider } from "@vjdesigns/vjdesigns-ui";

Importing only Divider adds about 1.0 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.

Examples

Horizontal

Above the line


or

tsx
import { Divider, Stack, Text } from "@vjdesigns/vjdesigns-ui";

export function Horizontal() {
  return (
    <Stack gap={4} style={{ width: "100%", maxWidth: "26rem" }}>
      <Text>Above the line</Text>
      <Divider />
      <Divider label="or" />
      <Divider variant="dashed" tone="primary" thickness="thick" />
    </Stack>
  );
}

With label

A labelled divider is a natural break between sign-in methods.

or sign in with email
tsx
import { Button, Divider, Stack } from "@vjdesigns/vjdesigns-ui";

export function WithLabel() {
  return (
    <Stack gap={4} style={{ width: "100%", maxWidth: "20rem" }}>
      <Button fullWidth variant="outline" tone="neutral">
        Continue with Google
      </Button>
      <Divider label="or sign in with email" />
      <Button fullWidth>Email me a link</Button>
    </Stack>
  );
}

Vertical

Docs

Pricing

Blog

tsx
import { Divider, Flex, Text } from "@vjdesigns/vjdesigns-ui";

export function Vertical() {
  return (
    <Flex gap={4} align="center" style={{ height: "2rem" }}>
      <Text size="sm">Docs</Text>
      <Divider orientation="vertical" />
      <Text size="sm">Pricing</Text>
      <Divider orientation="vertical" />
      <Text size="sm">Blog</Text>
    </Flex>
  );
}

Accessibility

A divider is a separator (role="separator") by default, and its label is readable text. When the line is purely visual, decorative hides it, label and all, from assistive technology.

or

By continuing you agree to the terms.

tsx
import { Button, Divider, Stack, Text } from "@vjdesigns/vjdesigns-ui";

export function Accessibility() {
  return (
    <Stack gap={4} style={{ width: "100%", maxWidth: "22rem" }}>
      <Button fullWidth>Continue with email</Button>
      <Divider label="or" />
      <Button variant="outline" tone="neutral" fullWidth>
        Continue with a passkey
      </Button>
      <Divider decorative />
      <Text size="sm" tone="muted">
        By continuing you agree to the terms.
      </Text>
    </Stack>
  );
}

Translated

A divider's label is your own text; translate it with the page. LocaleProvider sets lang, so it's read in Japanese.

または
tsx
import {
  Button,
  Divider,
  Stack,
  LocaleProvider,
} from "@vjdesigns/vjdesigns-ui";
import ja from "@vjdesigns/vjdesigns-ui/locales/ja";

export function Translated() {
  return (
    <LocaleProvider locale="ja" messages={ja}>
      <Stack gap={4} style={{ width: "100%", maxWidth: "22rem" }}>
        <Button fullWidth>メールで続ける</Button>
        <Divider label="または" />
        <Button variant="outline" tone="neutral" fullWidth>
          パスキーで続ける
        </Button>
      </Stack>
    </LocaleProvider>
  );
}

Right to left

The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.

Horizontal

Above the line


or

tsx
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";

// Horizontal is the "Horizontal" example above.
<LocaleProvider locale="ar" messages={ar}>
  <Horizontal />
</LocaleProvider>

Usage notes

Semantics:

  • Horizontal, no label: a native <hr> (implicit role="separator").
  • Vertical, no label: <div role="separator" aria-orientation="vertical">.
  • With a label: a <div> whose line segments are hidden and whose label is plain, readable text. A separator's children are presentational in ARIA, so putting the label inside one risks it not being announced; reading it as text in document order is the most reliable.
  • decorative: aria-hidden="true", no role; hidden from assistive tech.

API reference

Divider

Divider props
PropTypeDefault
orientation

Direction of the line. Vertical dividers stretch to the height of a flex row.

"horizontal""vertical"—
variant

Line style.

"solid""dashed""dotted"—
thickness

Line thickness.

"thin""thick"—
tone

Line color. neutral is the standard hairline; strong is a darker neutral; other tones use --color-{tone}-border.

"strong""neutral""primary""accent""success""warning""danger""info"—
spacing

Space around the line on the cross axis (block margin when horizontal, inline margin when vertical), as a --space-* step.

Space—
inset

Shorten the line from its start, end, or both ends.

"none""start""end""both"—
label

Inline label shown in the line (e.g. "or", "Second half"). Rendered as readable text, not inside an <hr>. children works the same way; label wins when both are set.

ReactNode—
children

Label content, as an alternative to label.

ReactNode—
labelPosition

Where the label sits along the line. Ignored without a label.

"start""center""end"—
decorative

Purely visual line. Hides the whole divider (including any label) from assistive technology with aria-hidden="true" and no separator role.

boolean—
ref

Ref to the root element (<hr> for a plain horizontal divider, otherwise a <div>).

Ref<HTMLElement>—

Also accepts native <div> attributes, plus className, style and ref.

See what changed in each version in the Changelog.

Accessibility report

Divider targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.

axe-core audit (live)

Running accessibility audit

Checking the examples above…

Lighthouse audit

Light mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Dark mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.

Built-in behavior

Keyboard

Not focusable, so there's no keyboard interaction of its own.

Roles and states

Roles and states
ElementRoleStates and properties
<hr> (horizontal)separator—
Vertical dividerseparatoraria-orientation="vertical"
decorativenonearia-hidden="true"

Manual checks

Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.

Manual accessibility checks
CheckWhat to testWCAG 2.2
KeyboardEvery action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck.2.1.1 (A), 2.1.2 (A)
FocusFocus moves in a logical order, is always visible, and isn't hidden behind sticky headers.2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA)
Screen readersNames, roles and states are announced correctly, and status changes are announced without moving focus.1.3.1 (A), 4.1.2 (A), 4.1.3 (AA)
ColorMeaning never depends on color alone; your own colors meet contrast in both modes.1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA)
Zoom and reflowAt 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed.1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA)
Pointer targetsClick and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap.2.5.8 (AA), 2.5.5 (AAA)
MotionAnimations respect the reduced-motion setting.2.3.3 (AAA)