`sp-divider` brings clarity to a layout by grouping and dividing content that exists in close proximity. It can also be used to establish rhythm and hierarchy.
npm install @spectrum-web-components/dividersp-divider brings clarity to a layout by grouping and dividing content that exists in close proximity. It can also be used to establish rhythm and hierarchy.
View the design documentation for this component.



``zsh`
yarn add @spectrum-web-components/divider
Import the side effectful registration of via:
`js`
import '@spectrum-web-components/divider/sp-divider.js';
When looking to leverage the Divider base class as a type and/or for extension purposes, do so via:
`js`
import { Divider } from '@spectrum-web-components/divider';
Horizontal dividers are used to separate content stacked vertically.
`html`Small
The small divider is used to divide similar components such as table rows,
action button groups, and components within a panel.
`html`Medium
The medium divider is used to divide subsections on a page, or to separate
different groups of components such as panels, rails, etc.
`html`Large
The large divider should be used only for page titles or section titles.
#### Vertical
Vertical dividers are used to separate content horizontally.
When a vertical divider is used inside of a flex container, use align-self: stretch; height: auto; on the divider.
`html`
style="align-self: stretch; height: auto;"
vertical
>
`html`
style="align-self: stretch; height: auto;"
vertical
>
`html`
style="align-self: stretch; height: auto;"
vertical
>
#### Static color
Use the static color option when a divider needs to be placed on top of a color background or visual. Static color dividers are available in black or white regardless of color theme.
`html
style="background-color: var(--spectrum-docs-static-black-background-color); color: var(--spectrum-black); padding: 20px"
>
Static black on light background
Use static black on light color or image backgrounds.
Static white
`html
style="background-color: var(--spectrum-docs-static-white-background-color); color: var(--spectrum-white); padding: 20px;"
>
Static white on dark background
Use static white on dark color or image backgrounds.
$3
The
element implements the following accessibility features:- ARIA role: Automatically sets
role="separator" to ensure proper semantic meaning for assistive technologies
- Orientation support: When vertical is true, automatically sets aria-orientation="vertical" to indicate the divider's orientation#### Best practices
- Medium or large dividers can be used with header text to visually create a section or page title. Place the divider below the header for best results.
- Ensure sufficient color contrast when using
static-color` variants on colored backgrounds.