ComponentsUpdated Sep 9, 2026
Resizable Div
Springs a container to the size of its content whenever the content changes. Used inside ActionPopover so toolbars grow and shrink smoothly.
Source: packages/ui/src/components/resizable-div
import { ResizableDiv } from '@highlight/ui'Change the props; the preview and the snippet update together.
Save
Props
Content
Animate width
Animate height
<ResizableDiv className="bg-background-subtle rounded-xl" containerClassName="px-4 py-2 text-sm"> Save</ResizableDiv>Save
import { useState } from 'react'import { Button, ResizableDiv } from '@highlight/ui' const LABELS = ['Save', 'Save and share', 'Save, share and notify everyone'] export default function ResizableDivBasic() { const [index, setIndex] = useState(0) return ( <div className="flex flex-col items-center gap-3"> <ResizableDiv className="bg-background-subtle rounded-xl" containerClassName="px-4 py-2 text-sm"> {LABELS[index]} </ResizableDiv> <Button size="sm" variant="outline" onClick={() => setIndex((value) => (value + 1) % LABELS.length)}> Change content </Button> </div> )}The root, then any compound sub-components. Every part accepts className and forwards the rest of its props to the element or Base UI part beneath it.
ResizableDiv- A div that animates its height to its content as the content changes.
Props added on top of the underlying element or Base UI part.
| Prop | Type | Default | Description |
|---|---|---|---|
animateWidth | boolean | true | Animate width changes. |
animateHeight | boolean | true | Animate height changes. With both false it renders a plain div. |
containerClassName | string | — | Class for the measured inner wrapper. |