Shopware Design

Divider

Usage

Divider separates related content into visual sections. Use it to structure lists, toolbars, or form areas where spacing alone does not create enough distinction. The divider stretches to the full width of its container, or to the full height when vertical.

import { MtDivider } from "@shopware-ag/meteor-component-library";

Examples

With content

Slot content renders centered between two divider lines, with a fixed gap on both sides.

With an action

A single small action can sit in the middle of the divider, for example to load older entries.

Vertical

A vertical divider stretches to the height of its container, for example between items in a toolbar.

Full bleed

By default the divider stays inset within the container padding. With full-bleed it stretches across the padding of surrounding containers such as Card, touching the container edges. This works like the Inset utility: the container provides --mt-inset-* custom properties matching its padding, and the divider compensates with negative margins.

Variants and color

The line style can be solid or dashed, and the color accepts any border color token name.

API reference

Props

PropTypeDefault
orientation
The direction of the divider line.
"horizontal" | "vertical""horizontal"
variant
The line style of the divider.
"solid" | "dashed""solid"
color
Color token used for the divider line, for example "color-border-brand-default".
string"color-border-secondary-default"
decorative
Marks the divider as purely visual so assistive technologies ignore it.
false | truefalse
full-bleed
Stretches the divider across the padding of the surrounding container, for example to span the full width of a card.
false | truefalse

Slots

SlotBindings
defaultany

Best practices

Do
  • Use it when sections need a stronger visual boundary than whitespace provides.
  • Keep slot content short, for example "or" in login flows or a small badge.
  • Use Text with the secondary color for textual divider content.
Don't
  • Do not use dividers between every element, generous spacing often structures content better.
  • Do not use it as a decorative line unrelated to content structure.
  • Do not place more than a single small action inside the divider content.

Behavior

  • The divider fills its container: full width when horizontal, full height when vertical. A vertical divider therefore needs a parent with a defined height, such as a flex row.
  • Without slot content a single continuous line renders. With slot content the line splits into a start and end segment with the content centered between them.
  • color accepts a design token name such as color-border-brand-default and defaults to the secondary border color.
  • With full-bleed the divider extends across the container padding in its line direction: horizontally through the inline padding, vertically through the block padding. The container must provide the --mt-inset-* custom properties, as Card does.

Accessibility

  • The divider renders with role="separator" and the matching aria-orientation when it separates content in a meaningful way.
  • Set decorative for purely visual dividers without semantic meaning, this removes the separator semantics so assistive technologies skip the element.
  • With slot content the separator role is dropped, because a separator hides its children from assistive technologies. The content is announced on its own, so keep it meaningful and avoid decorative filler text.
  • Card: when sections deserve their own contained surface instead of a simple separation.