Visually divides content with a one pixel line in the border color.
<script lang="ts">
import { Separator } from "#lib/components/ui/separator/index.js";
</script>
<div>
<strong>PlainSv</strong>
<p>Svelte components styled with theme tokens.</p>
</div>
<Separator />
<nav>
<span>Docs</span>
<Separator orientation="vertical" />
<span>Components</span>
</nav>pnx remote0 add https://plainsv.com/r/separator.jsonSet orientation="vertical" to draw a line between items in a row. It stretches to the height of its flex container, so give the row a height or content to fill.
<div style="display: flex; gap: 1rem; height: 1.25rem">
<span>Blog</span>
<Separator orientation="vertical" />
<span>Docs</span>
</div>By default, the separator is decorative and hidden from screen readers with role="none". Set decorative={false} when it divides meaningful sections, so it is announced with role="separator" and, when vertical, aria-orientation="vertical".
The Separator props extend the native div attributes. It sets data-orientation for custom styles.
interface Props extends CompProps<"div"> {
/** Direction of the line; `vertical` stretches to the height of a flex row; defaults to `horizontal` */
orientation?: "horizontal" | "vertical";
/** Hides the line from screen readers when it is only visual; set `false` to announce it as a separator; defaults to `true` */
decorative?: boolean;
}