Separator

The Separator is a divider that separates and distinguishes sections of content or groups of menu items.

Give FeedbackWAI-ARIABundle Size
PreviousNext
SeparatorIntroduction.tsx

Installation

Base UI components are all available as a single package.

npm install @base-ui-components/react

Once you have the package installed, import the component.

import { Separator } from '@base-ui-components/react/Separator';

Anatomy

The Separator component is implemented using a single component: <Separator.Root />.

<Separator.Root />

Overriding default components

Use the render prop to override the rendered elements with your own components.

// Element shorthand
<Separator.Root render={<hr />} />
// Function
<Separator.Root render={(props) => <hr {...props} />} />

API Reference

SeparatorRoot

PropTypeDefaultDescription
classNameunionClass names applied to the element or a function that returns them based on the component's state.
renderunionA function to customize rendering of the component.

Contents