Separator
Visually or semantically separates content.
Preview
Installation
npx sigma-ui@latest add separatorUsage
<script setup lang="ts">
import { Separator } from '@/components/ui/separator';
</script>
<template>
<Separator label="Or" />
</template>labeldisplays a short text in the middle of the line.- Set
decorativewhen the separator is purely visual, so it is hidden from assistive technologies.
Examples
Vertical
Set orientation="vertical" to separate inline items. The parent needs a height.
<template>
<div class="flex h-5 items-center space-x-4 text-sm">
<div>Blog</div>
<Separator orientation="vertical" />
<div>Docs</div>
<Separator orientation="vertical" />
<div>Source</div>
</div>
</template>API Reference
Separator
Props
| Prop | Type | Default |
|---|---|---|
orientationOrientation of the component. Either | DataOrientation | - |
decorativeWhether or not the component is purely decorative. <br>When | boolean | - |
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
labelText displayed centered on the line. | string | - |
Accessibility
Renders an element with the separator role, or no role when decorative is set. It has no keyboard interactions of its own.
| Key | Description |
|---|---|
| None | Separator is not focusable. |