Skip to main content

Divider

Divider is a visual separator for content sections. It supports horizontal and vertical orientations with customizable colors.

Open in Storybook

Import

import { Divider } from "@tosui/react";

Basic Usage

Orientation

Left
Right

Colors

border
border-muted (default)
primary
accent
success
warning
error
info

Thickness

1px (default)
2px
3px
4px

Common Patterns

Section Separator

<VStack gap={6}>
<Box>
<Heading>Section 1</Heading>
<Text>Content for section 1...</Text>
</Box>
<Divider />
<Box>
<Heading>Section 2</Heading>
<Text>Content for section 2...</Text>
</Box>
</VStack>

Vertical in Navigation

<HStack gap={4} align="center">
<Link href="#">Home</Link>
<Divider orientation="vertical" h="20px" />
<Link href="#">About</Link>
<Divider orientation="vertical" h="20px" />
<Link href="#">Contact</Link>
</HStack>

Props Reference

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Divider orientation
color"border" | "border-muted" | "primary" | "accent" | "success" | "warning" | "error" | "info""border-muted"Divider color
thickness1 | 2 | 3 | 41Thickness in pixels
asElementType"hr" (horizontal) / "div" (vertical)HTML element to render

Accessibility

Divider includes proper ARIA attributes:

  • role="separator"
  • aria-orientation matching the orientation prop

TypeScript

import { Divider, type DividerColor, type DividerProps, type DividerOwnProps } from "@tosui/react";