Skip to content

Commit 1195a35

Browse files
eddimanpomfrida
andauthored
docs(design-system-docs): document Divider for EDS 2.0 (#4875)
* docs(design-system-docs): document Divider for EDS 2.0 Rewrites the Divider page for the new next/Divider component, moves it from Data Display to Surfaces, and registers a Surfaces sidebar category. Closes #4701 * /ficx/removed structure which contained code of divder, already in storybook * Update apps/design-system-docs/docs/components/surfaces/divider.md Co-authored-by: Frida Erdal <31915755+pomfrida@users.noreply.github.com> * fix/removed dupliacet line in when to use --------- Co-authored-by: Frida Erdal <31915755+pomfrida@users.noreply.github.com>
1 parent 2ffce4b commit 1195a35

3 files changed

Lines changed: 74 additions & 31 deletions

File tree

apps/design-system-docs/docs/components/data-display/divider.md

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
title: Divider
3+
sidebar_position: 2
4+
---
5+
6+
# Divider
7+
8+
A divider is a thin horizontal line that brings clarity to layout by grouping and separating content. Designed with care, dividers should be noticeable but never compete for attention - they help establish rhythm and hierarchy across our interfaces.
9+
10+
<iframe
11+
class="sb-iframe"
12+
src="https://storybook.eds.equinor.com/iframe.html?globals=&args=&id=eds-2-0-beta-surface-divider--introduction"
13+
width="100%"
14+
height="245"
15+
frameborder="1"
16+
></iframe>
17+
18+
[View in Storybook](https://storybook.eds.equinor.com/?path=/story/eds-2-0-beta-surface-divider--introduction)
19+
20+
## When to Use
21+
22+
Use a divider to group related content or separate sections of a layout when white space alone is not enough to communicate the structure.
23+
24+
- Use dividers occasionally, to create groupings rather than separate individual items
25+
- Dividers should be noticeable in a layout, but not clashing
26+
- Dividers should only be used if elements can't be split using white space
27+
28+
**Avoid dividers for:**
29+
30+
- Decorating layouts where white space already creates clear separation
31+
- Splitting every individual item in a list - reserve them for meaningful groupings
32+
33+
## Accessibility
34+
35+
Dividers follow the [WAI-ARIA separator pattern](https://www.w3.org/TR/2017/REC-wai-aria-1.1-20171214/#separator) and renders as a native `<hr>`, which has the implicit ARIA role separator.`.
36+
37+
- Use the divider as a decorative separator between groups of related content - it communicates structure visually without becoming an interactive element
38+
- Keep enough contrast between the divider and its background so the separation reads clearly, while staying subtle enough to avoid clashing with surrounding content
39+
- Do not rely on dividers alone to convey grouping for assistive technology - structure content with appropriate landmarks, headings, or list semantics
40+
41+
## Figma
42+
43+
### Components
44+
45+
- **Divider [EDS]**: A thin horizontal line using the subtle border colour token
46+
47+
### Using the Divider in Figma
48+
49+
1. In Figma, go to the **Assets Panel** and search for **Divider**
50+
2. Drag the component into your frame
51+
3. Resize the divider horizontally to match the width of the container it separates
52+
53+
The divider uses the `--eds-color-border-subtle` token, so it adapts automatically to the active theme mode set on the containing frame.
54+
55+
## Do's and Don'ts
56+
57+
:::info **Do**
58+
59+
- Use dividers to group related content into meaningful sections
60+
- Let the surrounding layout control the divider's width - the component fills its container by default
61+
- Keep dividers consistent across similar layouts to reinforce rhythm and hierarchy
62+
:::
63+
64+
:::danger **Don't**
65+
66+
- Place a divider between every item in a list - white space is usually enough
67+
- Use dividers as decoration where they add visual noise without clarifying structure
68+
- Override the subtle border colour with a stronger tone - dividers should support content, not compete with it
69+
:::

apps/design-system-docs/sidebars.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ const sidebars: SidebarsConfig = {
9090
label: 'Navigation',
9191
items: ['components/navigation/link'],
9292
},
93+
{
94+
type: 'category',
95+
label: 'Surfaces',
96+
items: ['components/surfaces/divider'],
97+
},
9398
],
9499
//Foundation Section
95100
foundationSidebar: [

0 commit comments

Comments
 (0)