Create

General

Separator

Copy page View as Markdown Open in ChatGPT Open in Claude

Visually or semantically separates content.

Usage#

app.component.ts
import { WdsSeparatorComponent } from '@wds/angular/separator';

Set the spacing around the separator with classes on it (e.g. my-4). Menus, fields and other components have their own separators (wds-dropdown-separator, wds-field-separator…); use wds-separator everywhere else.

Examples#

Default#

A horizontal separator spans the width of its container. orientation="vertical" stretches to the height of a flex row (here h-5).

WDS Components
Web components for enterprise apps.
Blog Docs Source

Decorative#

Between links that are already separate items, the line is only decoration: decorative hides it from screen readers.

With label#

Text in the slot sits in the middle of a horizontal line.

Continue with GitHub Or continue with Sign in with email

With icon#

An <svg> (14px) or a wds-icon before the text of the label.

Today Milestone 2

List#

Separators between rows of a list in a bordered box.

Two-factor authentication On
Login alerts On
Trusted devices 3

Order summary#

A separator sets the total apart from the lines above it.

Subtotal $316.00
Shipping $12.00
Tax $25.28
Total $353.28

Color and size#

--wds-separator-color sets the color of the line and --wds-separator-size its thickness. The label takes the text color of the separator.

Today

API References#

wds-separator#

A line that separates content: sections of a page, items in a list or a toolbar. Horizontal by default; a vertical one stretches to the height of its row in a flex container. Text in the slot sits in the middle of a horizontal line (e.g. "or", "Continue with"). The separator is role="separator". When it only decorates (e.g. between links in a footer) set decorative, so screen readers skip it.

Attributes

AttributeTypeDefaultDescription
orientationWdsSeparatorOrientation'horizontal'Direction of the line.
decorativebooleanfalsePurely visual: hidden from screen readers (role="none").

Slots

SlotDescription
(default)Text in the middle of a horizontal line, optionally with an <svg> icon (14px) or wds-icon.

CSS parts (::part)

PartDescription
baseThe line (with the text).
labelThe text.

CSS custom properties

PropertyDescription
--wds-separator-colorColor of the line (default --wds-border).
--wds-separator-sizeThickness of the line (default 1px).

Accessibility#

Screen reader#

The separator has role="separator", and a vertical one also aria-orientation="vertical". Screen readers announce it between sections.

decorative sets role="none": use it when the line only decorates, e.g. between links or between rows that are already separate items.

The text of a labeled separator is read as plain text.

Keyboard support#

The separator is not focusable and has no keyboard interaction.

Footer