Separator
The Separator is a divider that separates and distinguishes sections of content or groups of menu items.
Installation
Base UI components are all available as a single package.
npm install @base_ui/react
Once you have the package installed, import the component.
import { Separator } from '@base_ui/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
| Prop | Type | Default | Description |
|---|---|---|---|
className | union | Class names applied to the element or a function that returns them based on the component's state. | |
render | union | A function to customize rendering of the component. |