Components · Layout and structure

Divider

A 1 px line that separates siblings. One geometry, one neutral — the system's structural rule. Weight comes from the spacing around the line, not from a thicker stroke.

Documentedby Derek Fidler

Account settings

Billing

Notifications

Default

Overview

The Divider lives in @flatpay-dk/ui and renders the system’s canonical 1 px line. One axis — orientation(horizontal or vertical) — and that’s the entire surface area. The component never gets thicker, never changes colour for emphasis. Need a heavier break? Use more space, not a thicker line.

One geometry, one neutral

Anything thicker than 1 px stops reading as structure and starts reading as decoration — see the Border foundation for the rule. The divider uses the same --bordertoken every other surface in the system uses; we don’t ship a separate divider palette.

Orientation

Horizontal by default. Vertical when adjacent siblings sit on the same row — stat bars, toolbars, kbd shortcut clusters. The component stretches to fill its parent on the cross-axis: a horizontal divider fills the parent’s width, a vertical one fills its height.

Profile

Workspace

orientation="horizontal"

Default. Spans the full width of its parent. Use between stacked sections of the same surface.

Today

€ 1.075,25

Yesterday

€ 1.114,00

orientation="vertical"

Stretches to the parent’s height. Use between adjacent values in a stat bar, kbd shortcut row, or toolbar.

In context

Two real surfaces — a settings list with horizontal dividers between rows, and a stat bar with vertical dividers between values. Dividers are siblings of the content; they do not wrap their parent.

  • Account settings

    Manage your profile, password, and authentication.

  • Workspace

    Members, invites, and shared resources.

  • Billing

    Plan, payment method, invoices.

  • Notifications

    Email, in-app, and webhook preferences.

Prototypes

42

Demo ready

11

Building

23

Archived

8

Divider vs. divide-*

When every sibling in a list needs a line between it, reach for Tailwind’s divide-y /divide-xon the parent. It’s less DOM noise, the spacing is implicit, and the rule reads as one decision instead of N. Use <Divider /> when you need one explicit, semantic break — between the manage and danger sections of a menu, between the profile and workspace regions of a settings card.

tsx

// ✓ Repeating siblings — let the parent draw the lines
<ul className="divide-y rounded-2xl border bg-card">
  <li className="px-5 py-4">…</li>
  <li className="px-5 py-4">…</li>
  <li className="px-5 py-4">…</li>
</ul>

// ✓ One semantic break between two regions
<section>
  <ProfileForm />
  <Divider className="my-6" />
  <WorkspaceForm />
</section>

Accessibility

  • Semantic by default. Renders role="separator" with the matching aria-orientation. Screen readers announce a break in content.
  • Decorative escape hatch. Set decorative when the line is purely visual — for instance, a thin separator inside a composed glyph or a prose flourish — and the component drops the separator semantics.
  • Don’t over-announce.When you’ve reached for divide-y, you don’t need separator semantics on every row — the list structure (role="list") already communicates the grouping.

Code

The component is purely presentational — no state, no events. Two props.

tsx

import { Divider } from "@flatpay-dk/ui";

// Horizontal, the most common case
<Divider />

// Vertical, between two values in a stat bar
<div className="flex h-12 items-center gap-4">
  <span>Today</span>
  <Divider orientation="vertical" />
  <span>Yesterday</span>
</div>

// Decorative — opt out of separator semantics
<Divider decorative />

Best practices

Today’s payouts€ 1.075,25
Pending€ 200,00
Refunded€ -12,50

Do

Hug the dividers tight against their siblings — the line is the spacer. Generous gap on either side adds noise.

Today’s payouts€ 1.075,25
Pending€ 200,00
Refunded€ -12,50

Don't

Don't pad both sides of the divider. The list breathes; the line doesn't need its own breathing room.

Profile

Manage your name and authentication.

Workspace

Members and shared resources.

Do

Use one divider to separate two distinct regions inside a card. The break is the meaning.

Account settings

Update your name, email, and notification preferences from a single page.

Don't

Don't sprinkle dividers between every paragraph and button. Three lines in a small card means none of them carry weight.

  • Default to spacing, not lines. Most separation between siblings is solved by gap-* on the parent. A divider is an explicit this is a breaksignal — reach for it when whitespace alone isn’t doing the work.
  • Inside a card → space, not a line. A card is already a containment border; another line on its outer edge competes. Internal section breaks usually want extra padding, not another stroke.
  • Don’t recolour for status.A red or amber divider isn’t how status enters the system — that’s what status pills, banners, and inline messages are for. Dividers stay mono.
  • Never thicken the stroke.If the divider needs to feel heavier, increase the spacing on either side — don’t add h-0.5. Anything thicker than 1 px stops reading as a divider.

Props

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Direction of the line. Horizontal stretches to the parent's width; vertical stretches to its height.
decorativebooleanfalseWhen true, drops the separator semantics. Use only for purely visual lines that don't represent a content break.
classNamestringForwarded to the underlying div. Useful for adding margin (my-6) when the divider sits between flow elements.