Content divider

Divider separates or groups content with a line, a labelled line or a section band. Use it to break up long content.

  • Beta
  • Accessibility
  • Figma Content Divider 82:13579
  • packages/ui/src/components/Divider

Beta until Figma fixes the label colour binding and the “Seperator” spelling, and design confirms the merged action type and the vertical orientation (C39). Everything else on this page is implemented and tested.

Preview

Change the controls to try every type. The preview renders the real component and the code updates with it.

Photosynthesis basics
or
The Calvin cycle
tsx
import { Divider } from '@nuton/ui'

<Divider type="text-line">or</Divider>

Installation

Availability

@nuton/ui and @nuton/tokens are private workspace packages. They aren't published to a registry yet (D4: registry deferred; D12: distribution waits on the provenance review). Inside the Nuton monorepo, add them as workspace dependencies. The commands below apply once the packages are published.

1. Add the packages

bash
pnpm add @nuton/ui @nuton/tokens

Peer dependencies: react and react-dom 18 or later. Add @remixicon/react only if you put icon buttons in an action divider (D1).

2. Load tokens and component styles once

tsx
// app/layout.tsx (or your app's entry file)
import '@nuton/tokens/tokens.css' // --nu-* design tokens
import '@nuton/ui/styles.css'     // component styles (uses the tokens)

Divider has no state and works in server components.

Usage

tsx
import { Divider } from '@nuton/ui'

export function LessonNotes() {
  return (
    <article>
      <p>Plants turn light into chemical energy in their chloroplasts.</p>
      <Divider />
      <p>Next, we look at how the Calvin cycle uses that energy.</p>
    </article>
  )
}
  • The default is a 1px line in Stroke/Soft-200 that fills the width of its container.
  • Pick the type by what the divider carries: nothing (line, line-spacing), a label (text-line, text, solid-text, section) or controls (action).
  • Write labels in sentence case, such as “or” or “Today”. The uppercase types transform them, so screen readers still read a word, not letters.
  • Dividers are decorative by default. Set decorative={false} only for a real thematic break that people should hear.
  • Spacing around the divider comes from the parent layout (a gap or margin), not from the divider.

Variants and sizes

One type prop covers Figma's ten Type values. Every line is 1px Stroke/Soft-200, and the four button types share one action type that takes your own controls.

Line and line spacing

Labelled types

or
Earlier this week
Today
Week 2 · Cell biology

Action

Figma's Icon Button, Icon Button Group, Text Button and Text Button Group become one action type: a line, your controls, a line.

Figma draws 32px and 28px controls. Use Button sm (36) or Button group sizes; the divider centres whatever you pass.

Orientation

vertical applies to line, line-spacing, text-line and action; the other types stay horizontal. It stretches to the height of a flex row, or set a height on the divider. Figma has no vertical variants; they were added for the brief (C39).

Dimensions

typeFigma TypeBoxType styleFill
lineLine1px tall, full width—Stroke/Soft-200
line-spacingLine Spacing4px band, 1px line centred (1.5 above and below)—Stroke/Soft-200 line
text-lineText & Line DividerLine, label, line; 10 gapSubheading/Small (14/20), uppercase—
textText DividerPadding 4 / 8Label/Small (14/20)—
solid-textSolid Text DividerPadding 6 / 20, 6 gapSubheading/2X Small (11/12), uppercaseBg/Weak-50
actionIcon Button · Icon Button Group · Text Button · Text Button GroupLine, controls, line; 10 gap; controls keep their sizeFrom the controls—
sectionSeperator (sic)Padding 12 / 100 (at most 8% of the viewport width), 40 gapLabel/Medium (16/28)Bg/Soft-200

Values in px, from the component CSS, which follows Figma's geometry. Label text is Text/Sub-600 in every type. Vertical lines are 1px wide with a minimum of 8px each side of a label. The section band's narrow-screen inset is a code addition, pending a decision.

Composition examples

Two ways to add notes

A text-line divider separates two alternatives in the create-lesson flow.

or

A YouTube video, article or PDF.

Lessons grouped by week

A section band titles a group. When the label is a real heading for navigation, put the heading inside the divider so it appears in the page outline.

Week 1 · What is a cell?
  • Cell membranes
  • Organelles
Week 2 · Cell biology
  • Photosynthesis basics
tsx
<Divider type="section">
  <h3>Week 2 · Cell biology</h3> {/* reset the heading's margins and type in your styles */}
</Divider>

Chat history by day

Today
  • Why do leaves change colour?Biology 101 · 10:42
Yesterday
  • Balancing chemical equationsChemistry revision · 18:05

Load more lessons

An action divider holds a control between content. After loading, focus moves to the first new lesson.

  • Photosynthesis basicsLesson 1
  • Light reactionsLesson 2

A thematic break people should hear

Most dividers are visual. When a break carries meaning, such as the end of the reading before a lesson's quiz, set decorative={false}. Screen readers announce a separator with the label as its name.

That covers the light reactions. Check what you remember.

1. Where in the cell does photosynthesis happen?

API reference

Props

Content divider props
PropTypeDefaultDescription
type'line' | 'line-spacing' | 'text-line' | 'text' | 'solid-text' | 'action' | 'section''line'Figma Type. See Dimensions for what each draws.
orientation'horizontal' | 'vertical''horizontal'Vertical applies to line, line-spacing, text-line and action; ignored by the others. Stretch it in a flex row.
decorativebooleantruetrue: lines are hidden from assistive technology and a label is read as plain text. false: role="separator", named by aria-label or a string label, with aria-orientation when vertical. Ignored by action.
childrenReactNode—The label (Figma “Edit Text”) for the text types, or the controls for action. Ignored by line and line-spacing.
refRef<HTMLDivElement>—Forwarded to the root div.
…restHTMLAttributes<HTMLDivElement>—Any native div attribute (className, aria-label, id…). className is merged. Attributes you pass override the computed ARIA, so don't pass aria-label={undefined} explicitly.

Types exported: DividerProps, DividerType and DividerOrientation.

Styling hooks

The component renders .nu-divider with data-type and data-orientation, plus .nu-divider__line and .nu-divider__label inside. Use props rather than styling these. The supported override points are these component properties:

PropertyDefaultControls
--nu-divider-color--nu-stroke-soft-200Line colour
--nu-divider-text-color--nu-text-sub-600Label colour (Figma binds Soft-400; see Contrast)
--nu-divider-gap--nu-space-2-5Gap between lines and the label or controls
--nu-divider-section-pad-inline100pxSection band inset, capped at 8vw

Accessibility

Keyboard

KeyBehaviour
TabSkips the divider; it is never focusable. In an action divider, Tab reaches your controls as usual.

Screen readers

By default, lines are hidden and a label is read as plain text. With decorative={false}, the divider is a separator named by its label or aria-label. Action dividers never take the separator role, because a separator's content isn't operable.

Focus

No focus state; the divider isn't interactive. Controls in an action divider keep their own focus ring.

Contrast and colour

Figma binds labels to Text/Soft-400, 2.49:1 on white and 2.33:1 on Weak-50. Code uses Text/Sub-600 (6.69:1 and 6.24:1, D7, C12, C39). Lines are decorative. In forced colours, lines use CanvasText and bands get a border.

Touch and pointer

The divider has no target. In an action divider, the controls you pass set the target size; Button sm is 36 × 36.

You must: give a non-decorative line an aria-label; use a real heading, not a divider label, when the text is a section heading; keep labels short and in sentence case; label icon-only buttons in an action divider.

Figma mapping

Figma propertyFigma valuesCode
TypeLine · Line Spacing · Text & Line Divider · Text Divider · Solid Text Divider · Seperatortype: line · line-spacing · text-line · text · solid-text · section
TypeIcon Button · Icon Button Group · Text Button · Text Button Grouptype="action" with your Button or ButtonGroup as children
Edit TextDefault “OR”children
Label colourText/Soft-400Text/Sub-600 (C39)
Not in FigmaVertical, semantic separatororientation, decorative

Figma fixes pending (C39)

Figma's labels bind Text/Soft-400, which fails AA, and the Type value is spelled “Seperator”. Both are to be fixed in the D9 branch. Merging the four button types into action and adding vertical are code decisions for design to confirm.

Guidelines and related components

Use Content divider for

  • Breaking long content, like lesson notes, into visual chunks.
  • Separating alternatives: upload notes or paste a link.
  • Grouping lists by week or day, or placing a “Show more” control between content.

Don't use Content divider for

  • Separating items in a menu. Use the separator in Dropdown menu.
  • Adding space. Use the layout gap (Spacing).
  • Section headings that people navigate by. Use a real heading.

Do and don't

Light reactionsThe Calvin cycle
DoUse a divider where content changes topic. Each line then means something, so people notice it.
Light reactionsChlorophyllWaterOxygen
Don'tDon't put a line between every item. Constant lines add noise and hide the real breaks.
or
DoKeep labels to a word or two. “or” and “Today” read at a glance.
or you can paste a link
Don'tDon't write sentences in a divider. Uppercase, small text is hard to read at length.
Today
Yesterday
DoPick one divider style per surface. A single style makes the hierarchy easy to follow.
Today
Yesterday
Don'tDon't mix types for the same job. People look for a meaning in the difference.

Common mistakes

  • Typing labels in capitals (“OR”), so some screen readers may spell them out. Write “or”; the type uppercases it.
  • Placing a horizontal divider directly in a flex row, where it shrinks to zero width. Give it a full-width parent.
  • Setting decorative={false} on every divider, which fills the reading order with separators.
  • Restyling the label to Soft-400 to match Figma; that fails contrast (C39).