Separator
A line that divides sections of content or groups of items. It renders a div with role separator and aria-orientation, and draws nothing: give it a size and a colour, selected by data-horizontal or data-vertical. It is not focusable.
- Size
- 0.7 kB
Example
Unstyled, accessible UI primitives for SolidJS.
DocsComponentsSource
import { Separator } from "menhir/separator";
export default function SeparatorExample() {
return (
<div class="w-64">
<p>Unstyled, accessible UI primitives for SolidJS.</p>
<Separator.Root class="my-3 h-px bg-stone-300 dark:bg-stone-700" />
<div class="flex gap-3">
<span>Docs</span>
<Separator.Root
orientation="vertical"
class="w-px bg-stone-300 dark:bg-stone-700"
/>
<span>Components</span>
<Separator.Root
orientation="vertical"
class="w-px bg-stone-300 dark:bg-stone-700"
/>
<span>Source</span>
</div>
</div>
);
}
Anatomy
<Separator.Root />API reference
Root
<div role="separator" aria-orientation>, with data-horizontal or data-vertical. Render an <hr> with render if you prefer one; the browser then draws its border and margins.
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | Whether the separator divides content stacked above and below it, or side by side. |
render | (props) => JSX.Element | — | Renders the separator with your own element. Read once. |
Keyboard
| Keys | Action |
|---|---|
| Tab | Moves past the separator, which is not focusable. |