ui.separator · parts: Separator · elements: <hr>
Separator is the native
(implicit role=separator). Vertical adds aria-orientation; Decorative removes the semantics with role=none.
<hr>already has the implicit roleseparator(horizontal), so a horizontal separator renders no ARIA at all.orientation="vertical"addsaria-orientation="vertical"(only for vertical; horizontal is the implicit default). Style the vertical line yourself, e.g.class="h-6 border-l border-border".- Decorative:
decorativerendersrole="none"and dropsaria-orientation. Chosen overaria-hidden="true": the element is purely presentational, so removing its semantics (none, allowed onhrby ARIA in HTML) is the precise statement;aria-hiddenwould hide a node that has no content anyway and is meant for content-bearing elements. - Void element: no children. Colors only via tokens (
border-border), spacing on the 8+4 grid (my-4,mx-2).
Separator renders a void hr; no children.
| Canonical (templ, Jinja2, MiniJinja) | React / Solid | HTML (Svelte, Vue, WC) | Type | Default | Kind | Description |
|---|---|---|---|---|---|---|
Orientation |
orientation |
orientation |
"horizontal" | "vertical" |
— | prop | horizontal (default) | vertical |
Decorative |
decorative |
decorative |
boolean |
— | prop | purely visual: role=none, no separator semantics |
Also accepts: class (className in React), extra attributes (rest props in UI frameworks, Attrs in templ/Jinja2/MiniJinja, attrs in Twig/Latte; caller wins).
No variants: the primitive ships no visual classes; style it with token classes via class.
Void / self-contained element: children are not accepted.
- Computed/forwarded:
role,aria-orientation(omitted when empty).
Compose the part's classes without rendering it (custom root element, no asChild outside React):
| Runtime | Helper |
|---|---|
| React / Solid / Vue / Svelte / WC | separatorClasses({ ... }) from separator/separator.shared.ts |
| templ | separator.SeparatorClasses(separator.SeparatorProps{...}) |
| Twig | ui8kit_classes('separatorClasses', { class: '…' }) |
| Latte | \UI8Kit\Latte\Classes::separatorClasses(['class' => '…']) |
| Jinja2 | separator_classes(p) |
| MiniJinja | separator_classes(p) (registered by ui8kit_minijinja::register) |
Canonical renderer output (children = Content); all 10 runtimes are parity-tested to produce this DOM.
| State | Props | HTML |
|---|---|---|
| defaults | — | <hr> |
| horizontal | {"Class":"my-4 border-border"} |
<hr class="my-4 border-border"> |
| vertical | {"Orientation":"vertical","Class":"mx-2 h-6 border-l border-border"} |
<hr class="mx-2 h-6 border-l border-border" aria-orientation="vertical"> |
| decorative | {"Decorative":true,"Orientation":"vertical","Class":"border-border"} |
<hr class="border-border" role="none"> |
| Orientation=horizontal | {"Orientation":"horizontal"} |
<hr> |
| Orientation=vertical | {"Orientation":"vertical"} |
<hr aria-orientation="vertical"> |
| Decorative | {"Decorative":true} |
<hr role="none"> |
Fixture horizontal ({"Class":"my-4 border-border"}) — every snippet renders:
<hr class="my-4 border-border">React (runtime notes)
import { Separator } from "./ui/separator/separator";
<Separator className="my-4 border-border" />Vue 3 (runtime notes)
<script setup lang="ts">
import Separator from "./ui/separator/Separator.vue";
</script>
<template>
<Separator class="my-4 border-border" />
</template>Svelte 5 (runtime notes)
<script lang="ts">
import Separator from "./ui/separator/Separator.svelte";
</script>
<Separator class="my-4 border-border" />SolidJS (runtime notes)
import { Separator } from "./ui/separator/separator.solid";
<Separator class="my-4 border-border" />Web Components (runtime notes)
import { renderSeparator } from "./ui/separator/separator.wc";
document.body.append(renderSeparator({ class: "my-4 border-border" }));Go templ (runtime notes)
import "github.com/ui8kit/codegen/generated/templ/ui/separator"
@separator.Separator(separator.SeparatorProps{Class: "my-4 border-border"})Twig (runtime notes)
{% include 'separator/Separator.html.twig' with { class: 'my-4 border-border' } only %}Latte (runtime notes)
{include 'separator/Separator.latte', class: 'my-4 border-border'}Jinja2 (runtime notes)
{% with p = {'Class': 'my-4 border-border'} %}{% include 'ui/separator/separator.html.j2' %}{% endwith %}MiniJinja (Rust) (runtime notes)
{% import 'ui8kit.html' as ui %}
{{ ui.separator({'Class': 'my-4 border-border'}) }}