Skip to content

feat: add mt-divider component - #1287

Open
Arnold Stoba (arnoldstoba) wants to merge 2 commits into
mainfrom
feat/add-divider-component
Open

feat: add mt-divider component#1287
Arnold Stoba (arnoldstoba) wants to merge 2 commits into
mainfrom
feat/add-divider-component

Conversation

@arnoldstoba

@arnoldstoba Arnold Stoba (arnoldstoba) commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What?

New mt-divider component: a horizontal or vertical separator line.

  • orientation: horizontal (default) / vertical
  • variant: solid (default) / dashed
  • color: any border color token, defaults to color-border-secondary-default
  • alignment: places slot content center (default), left, or right; the line on the aligned side is removed
  • decorative: removes the separator semantics for purely visual lines
  • full-bleed: stretches the divider beyond its container by the default card padding, e.g. to span the full width of a card
  • optional slot for centered content (e.g. "or" in login flows, or a small action)

Closes #1197

Why?

Sections often need a stronger visual boundary than whitespace provides; until now there was no dedicated separator component (see #1197).

How?

  • The line segments are ::before/::after pseudo-elements, so slot content renders centered between two flexible segments with a fixed gap; alignment suppresses the segment on the aligned side.
  • Accessibility follows the separator role rules: role="separator" with matching aria-orientation by default, role="none" when decorative. With slot content the role is dropped entirely, because ARIA treats a separator's children as presentational — this keeps e.g. a button inside the divider reachable for assistive technologies.
  • full-bleed applies negative margins of the default card padding (--scale-size-24): inline for horizontal dividers, block for vertical ones.

Testing?

  • Unit tests for orientation, variant, color token, alignment, decorative/separator semantics, slot content accessibility, and the full-bleed class.
  • Interaction test stories incl. nine visual test cases (default, dashed, brand color, with content, left/right alignment, vertical, full-bleed horizontal + vertical in a card).
  • Full-bleed layout and alignment behavior verified in headless Chromium for both orientations.

Anything Else?

  • Docs page with examples included (apps/docs).

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meteor-docs Ready Ready Preview, Comment Jul 24, 2026 11:15am
meteor-storybook Ready Ready Preview, Comment Jul 24, 2026 11:15am

Request Review

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New component: divider

1 participant