Overview
A divider is a line between two blocks of content. An empty divider draws one line. A divider with text draws the text between two lines, such as “or” between two sign-in options. nds-vertical turns it into a vertical line between items in a row.
Pick another component when:
- each row of a list needs a line under it: Definition List with
nds-divided - related buttons sit in one joined strip: Button group
Markup
Your request was received on 12 March 2026.
The ministry replies by email within three working days.
Variants
A Spacing class sets the space above and below a line, or before and after a vertical line. In the Vertical structure, put it on each divider.
| Group | Option | Markup | On element | Use |
|---|---|---|---|---|
| Structure | Line (default) | — | — | A line between two blocks of content. Use hr when the content changes topic, and an empty div when the line is only visual |
| Structure | Label | canon #divider-label |
— | Text between two lines. Keep the text to one word or a short phrase, such as “or” |
| Structure | Vertical | canon #divider-vertical |
— | A vertical line between items in a flex row. It stretches to the height of the row |
| Spacing | XS (default) | — | — | Tight space. Most uses |
| Spacing | MD | .nds-md |
.nds-divider |
A little more space |
| Spacing | LG | .nds-lg |
.nds-divider |
Space between groups in a form or a card |
| Spacing | XL | .nds-xl |
.nds-divider |
Space between parts of a page section |
| Spacing | 2XL | .nds-2xl |
.nds-divider |
Space between page sections |
| Spacing | 3XL | .nds-3xl |
.nds-divider |
A major break. Not between paragraphs |
| Spacing | 4XL | .nds-4xl |
.nds-divider |
The largest break. Not between paragraphs |
| Label position | Center (default) | — | div.nds-divider:not(.nds-vertical) |
The two lines share the space equally |
| Label position | Start | .nds-start |
div.nds-divider:not(.nds-vertical) |
No line before the label. The label sits at the start edge |
| Label position | End | .nds-end |
div.nds-divider:not(.nds-vertical) |
No line after the label. The label sits at the end edge |
| Label position | Custom | --divider-line-start: 24px |
div.nds-divider:not(.nds-vertical) |
The line before the label is at most 24px long, and the other line takes the rest. Set any length or percentage in the style attribute. --divider-line-end does the same from the end |
| Color | Default (default) | — | — | A faint gray line. Dark mode makes it a faint white line |
| Color | Primary | .nds-primary |
.nds-divider |
A brand primary line |
| On color | On color (hint: For a deep primary or dark background) | .nds-oncolor |
.nds-divider |
For a divider on a deep primary or dark background: a faint white line and a white label. With Primary, the line is the same white as the label. Inside an on-color area (data-theme="dark oncolor"), the divider already takes this look: skip the class |
| Thick | Thick | --divider-size: 2px |
.nds-divider |
A 2px line instead of 1px. Set it in the style attribute: there is no class for it |
Built-in Features
-
Text Annotation
Any content inside the divider turns it into a label between two lines. No extra class is needed.
-
Works on Any Element
The class works on
<hr>,<div>and<span>. The browser's own<hr>look is reset. A plain<hr>with no class gets the divider look too, so CMS content matches. -
Context Spacing
Inside a dropmenu, the space around a divider matches the menu padding. Inside
nds-prose, an<hr>gets 3XL space. A Spacing class still wins in both. -
Writing-mode Aware
Margins and lines use logical properties. In a parent with a vertical writing mode, the divider draws a vertical line with no extra class.
Best Practices
- Use a divider when white space alone does not show where one part ends.
- Do not put a divider between a card and the text around it. The card border already separates them.
- Use a label divider for a second path (“or”, “continue with”) or to name a group of form fields.
- Keep the label short. A long sentence competes with the lines.
- To make the label flush with an edge, use
nds-startornds-end. A--divider-line-startof0still leaves a gap before the label. - Pick the smallest spacing that gives enough room. Keep
nds-3xlandnds-4xlfor major breaks. - Put a vertical divider only in a flex row. Outside one it has no height to stretch to.
- Use the default color for most dividers. Use
nds-primaryonly where the line is an accent. - On a deep primary surface, give the surface
data-theme="dark oncolor primary": every divider inside takes thends-oncolorlook. See Color Areas. For one divider, addnds-oncolor. On a dark surface, addnds-oncolor, or give the surfacedata-theme="dark". - To change the line color on a tinted surface, set
--divider-coloron that surface, not on:root.
API
CSS Custom Properties
Set these on .nds-divider, or on a parent to change every divider inside it. A Spacing class sets --divider on the divider itself, so it wins over a parent value.
| Property | Default | Controls |
|---|---|---|
--divider |
var(--spacing-xs) |
Space above and below the line. On nds-vertical, the space before and after it |
--divider-size |
1px |
Line thickness, for the line and for both lines around a label |
--divider-line-start |
none |
The longest the line before a label may be. Any length or percentage. The other line takes the rest of the width. It shrinks in a narrow container. Start follows the text direction: in Arabic it is the right-hand line |
--divider-line-end |
none |
The same, for the line after a label |
--divider-color |
var(--colors-alpha-black-10) |
Line color. A semantic token: dark mode sets it to var(--colors-alpha-white-10). nds-primary uses var(--border-primary) instead, and nds-oncolor uses var(--border-oncolor). With both, the line takes the label color |