Component changelog
Collapsible changelog
Component-specific release notes collected from the full changelog. This page filters the published entries that mention Collapsible.
Release
v1.0.0
Patch Changes
-
10dbaf0: Document Collapsible keyboard interactions and ARIA references.
-
3406f13: fix(collapsible): publish measured content dimensions when forceMounted
With
forceMount,CollapsiblePrimitive.Contentis already present, so in the zero-duration branch bothsetHeight(undefined)andsetIsPresent(true)bail out as no-ops and no re-render is scheduled. The measurement from that pass lives only in refs, so the measured size never reached the CSS variables and--radix-collapsible-content-height/--rad-collapsible-content-heightwere left at their initial0.That matters most under
prefers-reduced-motion, where the resolved transition duration is0— so the affected path is the default for those users:<CollapsiblePrimitive.Root defaultOpen> <CollapsiblePrimitive.Content forceMount>…</CollapsiblePrimitive.Content> </CollapsiblePrimitive.Root>Before, the content height variable read
0px; it now reads the measured height. -
db4c358: Collapsible primitives respect
prefers-reduced-motionAdds a
usePrefersReducedMotionhook and uses it to resolve the Collapsible height transition.transitionDurationwas previously defaulted to300inCollapsiblePrimitive.Root, which meant the content type could not tell "the consumer asked for 300ms" apart from "nobody asked for anything". The default is removed and the value is resolved inCollapsiblePrimitiveContent:const resolvedTransitionDuration = transitionDuration !== undefined ? transitionDuration : prefersReducedMotion ? 0 : DEFAULT_TRANSITION_DURATION;So an unset
transitionDurationnow collapses the animation entirely whenprefers-reduced-motion: reduceis set, rather than still animating for 300ms. An explicittransitionDurationalways wins, which is the escape hatch for anyone who needs to keep animating.The hook is SSR-safe: it returns
falseuntil mounted, then follows the media query, and supports bothaddEventListenerand the legacyaddListenerAPIs.Note that
transitionDurationonCollapsiblePrimitiveRootPropsis unchanged for consumers — it was already optional at the prop level; only the internal default is gone.