Skip to content
Highlight

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

tsx
import { ResizableDiv } from '@highlight/ui'

Change the props; the preview and the snippet update together.

Save
Props
Content
Animate width
Animate height
tsx
<ResizableDiv className="bg-background-subtle rounded-xl" containerClassName="px-4 py-2 text-sm">  Save</ResizableDiv>
Save
tsx
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.

PropTypeDefaultDescription
animateWidthbooleantrueAnimate width changes.
animateHeightbooleantrueAnimate height changes. With both false it renders a plain div.
containerClassNamestring—Class for the measured inner wrapper.