Base Pure CSS

Divider

The rule between sections with role=separator; its middle slot takes a label — from the “or” between two ways to sign in to a whole phrase between two payment methods.

Real scenarios

The component as it is used in a product — not a specimen grid.

The sign-in card

The slot carries the «or» and a hairline grows on both sides, splitting the two ways in. For the screen reader the same mark is structural — the role=separator is always on the output, so the Google button and the email form read as two groups.

Two ways to pay at checkout

The label is not always one word: here a whole phrase — «یا پرداخت با» — bridges the bank gateway and the Nabu wallet. Both options are plain buttons, so the keyboard picks them as naturally as the pointer.

Order total: 1,560,000 Toman

The teammate card’s quiet rule

With no slot the two hairlines become one continuous line — :empty collapses the gap to zero. The default block margin (var(--nx-space-6)) is sized for page flow; inside a gapped container it usually wants taming with margin-block: 0, as it is here.

سارا محمدی Product designer · storefront team

Keeps the design system honest — her last pass matched the storefront’s dark theme to the fresh tokens.

12 projects 48 reviews given 1,402 member since

Important props

Important props
Prop Type Default What it does
slot string null The centered label (a word like “or” or a whole phrase); a hairline grows on both sides. Without a slot the two lines become one and the gap collapses.
role string 'separator' Always on the output so screen readers read the section boundary; the separator is structural and never focusable.
class / style attrs — Any other attribute lands on the div itself; the default block margin (var(--nx-space-6)) is sized for page flow and usually wants style="margin-block: 0" inside a gapped container.

Snippet

{{-- بدون برچسب: خط یکپارچه میان دو بخش --}}
<x-nx::divider />

{{-- با برچسب: «یا» میان دو راه ورود --}}
<x-nx::button variant="outline" icon="globe" block>ورود با گوگل</x-nx::button>
<x-nx::divider>یا</x-nx::divider>
<x-nx::input label="ایمیل سازمانی" type="email" wire:model="state.email" />

{{-- داخل ظرف gap‌دار: حاشیه را فشرده کنید --}}
<x-nx::divider style="margin-block: 0" />