Visual grouping
Break up controls within a menu, form, or settings panel.
Components / Display
A horizontal or vertical rule between related sections.
Break up controls within a menu, form, or settings panel.
Expose a division between two content groups when it helps navigation.
<script setup lang="ts">
import Separator from './components/ui/separator/Separator.vue'
</script>
<template>
<Separator />
<div class="flex h-6 items-center gap-4">
<span>First</span>
<Separator orientation="vertical" :decorative="false" />
<span>Second</span>
</div>
</template>The default decorative separator avoids adding extra noise to the accessibility tree.
<script setup lang="ts">
import Separator from './components/ui/separator/Separator.vue'
</script>
<template>
<section><h2>Profile</h2><p>Public information</p></section>
<Separator class="my-4" />
<section><h2>Security</h2><p>Sign-in options</p></section>
</template>Give a vertical separator a parent with a definite height.
<script setup lang="ts">
import Separator from './components/ui/separator/Separator.vue'
</script>
<template>
<div class="flex h-8 items-center gap-3">
<span>Draft</span><Separator orientation="vertical" :decorative="false" /><span>Updated today</span>
</div>
</template>The most useful props, models, slots, events, and methods for this component.
| Name | Type | Default or requirement |
|---|---|---|
orientation | horizontal | vertical | horizontal |
decorative | boolean | true |
Set decorative to false when the separator conveys structure to assistive technology.