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" |
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" |
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" |
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 |
decorativeMarks the divider as purely visual so assistive technologies ignore it. | false | true | false |
Slots
| Slot | Bindings |
|---|---|
default | any |
Best practices
- Use the divider when sections need a stronger visual boundary than only whitespaces.
- When displaying text, use the
mt-textcomponent with the secondary color token as the default.
- Do not use dividers in cases where just whitespace can achieve the same result.
- Do not place multiple elements inside of the divider content slot.
- Do not use the divider as decorative line without the
decorativeattribute.
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 by default.
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.