Separator
v0.0.10
mix mishka.ui.gen.headless separator
Overview of the Phoenix and LiveView Headless Separator Component
The Mishka Chelekom Headless Separator ships zero opinionated styling - only the semantic markup and the correct ARIA wiring. It renders a single div with role="separator" (or role="none" when purely decorative) and an aria-orientation attribute, plus a data-orientation attribute for styling. Pass an inner block to render an optional centered label. Style it entirely with your own Tailwind classes: class on the root and label_class on the label.
Base UI Separator example (Phoenix headless)
<div class="flex gap-4 text-nowrap">
<a href="/" class="text-sm text-neutral-950 dark:text-white">Home</a>
<a href="/chelekom" class="text-sm text-neutral-950 dark:text-white">Pricing</a>
<a href="/blog" class="text-sm text-neutral-950 dark:text-white">Blog</a>
<a href="/chelekom/docs" class="text-sm text-neutral-950 dark:text-white">Support</a>
<.separator
id="baseui-separator-hero"
orientation="vertical"
class="w-px bg-neutral-300 dark:bg-neutral-700"
/>
<a href="/auth" class="text-sm text-neutral-950 dark:text-white">Log in</a>
<a href="/auth" class="text-sm text-neutral-950 dark:text-white">Sign up</a>
</div>Separator example - with a label (Phoenix headless)
Text inside the separator becomes a span with data-part="label", drawn inside the root. The root here is a flex row, and its before: and after: pseudo-elements draw the two lines on either side, so the label sits in the middle. label_class styles the text.
Separator example - with a label (Phoenix headless)
<.separator
id="separator-label"
class="flex w-72 max-w-full items-center gap-3 before:h-px before:flex-1 before:bg-neutral-300 after:h-px after:flex-1 after:bg-neutral-300 dark:before:bg-neutral-700 dark:after:bg-neutral-700"
label_class="text-xs font-medium tracking-wide text-neutral-500 uppercase dark:text-neutral-400"
>
or continue with
</.separator>Parts & data attributes
The root carries a stable chelekom-separator class you can target, plus the current orientation as a data attribute. The label carries chelekom-separator__label.
| Part | data-part | State / ARIA | Purpose |
|---|---|---|---|
| Root | - | role="separator", aria-orientation, data-orientation | The divider element itself; takes class. |
| Label | label | - | Optional centered label rendered from the inner block; takes label_class. |
Accessibility
Follows the WAI-ARIA Separator role: the root exposes role="separator" with an aria-orientation matching the visual axis. Set decorative to switch to role="none" for purely visual dividers that should be hidden from assistive technology.
Attributes
| Name | Type | Default | Values | Required | Description |
|---|---|---|---|---|---|
id
|
string
| — | — | No | Optional id |
orientation
|
string
|
horizontal
|
horizontalvertical
| No | Axis of the separator |
decorative
|
boolean
|
false
| — | No | If true, the separator is purely visual (role=none) |
class
|
any
| — | — | No | Extra classes for the root |
label_class
|
any
| — | — | No | — |
rest
|
global
| — | — | No | — |
Slots
| Name | Required | Description |
|---|---|---|
inner_block
| No | Optional label for a labelled separator |
Options
Each option takes one or more of its values, separated by commas.
| Option | Values |
|---|---|
--type
|
separator
|
--module
| A module name of your own |
What it generates
mix mishka.ui.gen.headless separator