Expandable
Smooth animations for expandable content.
Containers on the web snap to their new size instantly when content changes. By measuring the bounds of a container and animating to those values, we can make these transitions feel smooth and intentional.
This technique uses grid template rows to create smooth height animations and the grid transitions between states, allowing the content to naturally expand and collapse without JavaScript measurement.
hooks/use-measure.ts
components/ui/expandable.tsx
components/examples/expandable.tsx