Separator
VdSeparator is a semantic divider with role="separator". Use it to break up stacked content, label a transition (e.g. "OR"), or split inline actions vertically. Pure CSS — no JavaScript.
Horizontal
Account settings
Billing
Danger zone
Labeled
OR
Theme-aware gradient
The compact divider used on About follows your primary color and light/dark theme.
OR
Before
After
After
Override --vd-separator-gradient-start, --vd-separator-gradient-end, --vd-separator-gradient-length (80px), or --vd-separator-gradient-thickness (3px) on the separator. Labeled gradients use the available width.
API Reference
Usage
<script setup lang="ts">
import { VdSeparator } from "@vanduo-oss/vd3";
</script>
<template>
<VdSeparator />
<VdSeparator variant="gradient" />
<VdSeparator label="OR" />
<VdSeparator vertical />
</template>CSS Classes
| Class | Description |
|---|---|
.vd-separator-gradient | Primary-to-info gradient; follows theme and primary color |
.vd-separator | Base divider — a hairline rule using the border token |
.vd-separator-vertical | Vertical orientation for use inside a flex row (give the row a height) |
.vd-separator-labeled | Horizontal divider with a centred label and a rule on each side |
.vd-separator-label | The text element inside a labeled separator |
Component API
| Prop | Description |
|---|---|
variant | "line" (default) | "gradient" — compact semantic primary/info divider. |
:label | Optional centred text; renders the labeled variant (horizontal only). |
:vertical | Renders a vertical divider for use inside a flex row (ignores label). |
Accessibility
- The plain and vertical variants render a native
<hr>, which already exposesrole="separator"; the vertical one addsaria-orientation="vertical". - The labeled variant uses a
<div>with an explicitrole="separator"so the "OR" text is announced. - Separators are decorative dividers — keep meaningful structure in headings and landmarks rather than relying on the rule alone.