|
| 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 | + ::: |
0 commit comments