Divider
Migration guide for Divider (renamed to Separator) from HeroUI v2 to v3
Refer to the v3 Separator documentation for complete API reference, styling guide, and advanced examples. This guide only focuses on migrating from HeroUI v2.
Component Rename
v2: Divider
v3: Separator
Key Changes
1. Component Name
v2: Divider
v3: Separator
2. Variant Prop
v3: Separator has a variant prop: default, secondary, tertiary for different emphasis levels (v2 Divider had no variant).
3. Props Comparison
| Prop | v2 | v3 | Notes |
|---|---|---|---|
orientation | ✅ | ✅ | Same: "horizontal" | "vertical" |
className | ✅ | ✅ | Same |
variant | ❌ | ✅ | New: "default" | "secondary" | "tertiary" |
Structure Changes
In v2, the component was named Divider:
import { Divider } from "@heroui/react";
export default function App() {
return (
<div>
<p>Content above</p>
<Divider />
<p>Content below</p>
</div>
);
}In v3, the component has been renamed to Separator:
import { Separator } from "@heroui/react";
export default function App() {
return (
<div>
<p>Content above</p>
<Separator />
<p>Content below</p>
</div>
);
}Migration Examples
With Variant
{/* v2 has no variant prop */}
<Divider /><Separator />
<Separator variant="secondary" />
<Separator variant="tertiary" />Summary
- Component Renamed:
Divider→Separator - Import Change: Update import from
DividertoSeparator - New in v3:
variantprop (default,secondary,tertiary) for emphasis levels
Migration Steps
- Update Import: Change
import { Divider }toimport { Separator } - Update Component: Replace all
<Divider />with<Separator /> - Same Props:
orientationandclassNamework the same - Optional: Use
variant="secondary"orvariant="tertiary"for different emphasis