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
Variants and color
The line style can be solid or dashed, and the color accepts any border color token name.
With content
Slot content renders centered between two divider lines, with a fixed gap on both sides.
Aligned content
With alignment="left" or alignment="right" the content moves to the corresponding edge and the divider line on that side is removed, for example for section labels, feed markers, or timestamps.
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 beyond its container by the default card padding, touching the edges of surrounding containers such as Card.
API reference
Props
| Prop | Type | Default |
|---|---|---|
orientationThe direction of the divider line. | "horizontal" | "vertical" | "horizontal" |
variantThe line style of the divider. | "solid" | "dashed" | "solid" |
colorColor token used for the divider line, for example "color-border-brand-default". | string | "color-border-secondary-default" |
alignmentWhere slot content sits on the divider. With "left" or "right" the line
on that side is removed and the content moves to the edge. | "center" | "left" | "right" | "center" |
decorativeMarks the divider as purely visual so assistive technologies ignore it. | false | true | false |
full-bleedStretches the divider beyond its container by the default card padding,
for example to span the full width of a card. | false | true | false |
Slots
| Slot | Bindings |
|---|---|
default | any |
Best practices
- 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.
- 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.
alignmentmoves slot content to theleftorrightedge; the line on that side is removed and a single segment fills the remaining space. Without slot content the prop has no effect.coloraccepts a design token name such ascolor-border-brand-defaultand defaults to the secondary border color.- With
full-bleedthe divider extends beyond its container by the default card padding (--scale-size-24) in its line direction: horizontally when horizontal, vertically when vertical.
Accessibility
- The divider renders with
role="separator"and the matchingaria-orientationwhen it separates content in a meaningful way. - Set
decorativefor 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.
Related components
- Card: when sections deserve their own contained surface instead of a simple separation.