Separator
VSeparator renders a horizontal or vertical rule without margins.
Usage
vue
Examples
Orientation
Vertical separators stretch in flex or grid layouts. In normal flow, set their height explicitly.
vue
Project settings
Who can open this project, and what they may change.
In ordinary flow, a height has to be given: here 3rem.
Label and icon
Set label, icon or the default slot, and place them with contentPosition. The label also becomes the separator’s accessible name.
vue
or
Featured
Variants, size and colour
variant strokes the rule solid, dashed or dotted, and size sets its thickness. color paints the strokes only; the label keeps the muted text colour.
vue
End of list
API
Props
| Prop | Type | Default |
|---|---|---|
orientation | SeparatorOrientation'horizontal' | 'vertical' | 'horizontal' |
| Horizontal or vertical rule. A vertical rule needs a height or a flex/grid layout that stretches it. | ||
variant | SeparatorVariant'solid' | 'dashed' | 'dotted' | 'solid' |
| How the rule is stroked: solid, dashed or dotted. | ||
size | SeparatorSize'sm' | 'md' | 'lg' | 'sm' |
| The thickness of the rule: 1px, 2px or 4px. A thicker rule marks a stronger break and makes dots legible. | ||
color | string | none |
| A CSS colour for the rule. The label and icon keep the muted text colour. | ||
label | string | none |
| Visible text breaking the rule, also used as the accessible name. | ||
icon | IconSource | none |
| An icon breaking the rule, before the label. | ||
contentPosition | SeparatorContentPosition'start' | 'center' | 'end' | 'center' |
| Where the label and icon sit along the rule. | ||
Slots
| Slot | Type |
|---|---|
default | {} |
Rich content breaking the rule, in place of the label. Name it with aria-label when its words matter. | |
Types
Types used in the API tables. Import exported types from vectis-ui.
export interface BuiltinIcon {
name: string
paths: readonly [string] | readonly [string, string]
}export type IconRender =
| { path: string; viewBox?: string }
| { component: Component; props?: Record<string, unknown> }
| { src: string }
| { text: string; class?: string }
| { class: string }export type IconSource = string | BuiltinIcon | IconRender
CSS variables
| Token | Value |
|---|---|
--vectis-control-size-separator-sm | 1px |
--vectis-control-size-separator-md | 2px |
--vectis-control-size-separator-lg | 4px |