Skip to content

Divider

A visual separator used to divide content in lists, menus, and form sections.

Also known as: separator, horizontal rule, line break, content divider

View in Storybook

When to use

  • To separate groups of items in dropdown menus or lists.
  • To visually divide sections of a form or page.
  • To display a labeled separator (e.g., "OR") between alternative actions.

Import

tsx
import { Divider } from '@vacano/ui'

Usage

tsx
<Divider />

With label

Provide a string as children to render centered text between two lines.

tsx
<Divider>OR</Divider>

Custom spacing

Control vertical margin with the spacing prop (in pixels).

tsx
<Divider spacing={4} />
<Divider spacing={16} />

Props

PropTypeDefaultDescription
childrenstring-Optional centered text label between the lines
spacingnumber8Vertical margin in pixels
classNamestring-CSS class name for the root element
classnamesDividerClassNames-Custom class names for inner elements
refRef<HTMLDivElement>-Ref forwarded to the root div element
data-test-idstring-Test identifier attribute

All standard HTML div attributes (except children and className) are also supported.

ClassNames

KeyDescription
lineThe horizontal line element(s). When a label is present, two line elements are rendered.
labelThe centered text label
  • Panel - Titled content section
  • FieldRow - Horizontal form field layout

Released under the MIT License.