useSsrBoot

Commons
stable

Defers CSS transitions until after the first browser paint to prevent flash-of-transition on SSR hydration. Returns an isBooted flag (false during SSR and the first rAF frame, then true) and a ssrBootStyles computed that injects `transition: none !important` while booting, suppressing unwanted entry animations during hydration.

API

Signature

Full TypeScript signature sourced from the composable file.

typescript

useSsrBoot uses requestAnimationFrame to defer the booted flag — it fires after the browser has painted the first frame, ensuring transitions are already in their final CSS state before they are re-enabled.

API

Return values

Properties and methods exposed by the composable return object.

ssrBootStyles
An object `{ transition: "none !important" }` when the component has not yet booted, or an empty array after the first animation frame. Spread onto the root element via :style to suppress hydration-flash transitions.
isBooted
False on the server and during the first rAF after mount, true thereafter. Useful as a guard before running DOM-dependent logic that assumes the component is fully hydrated.

Usage

Examples

Ready-to-paste usage snippets.

Suppress hydration-flash on a slide-in panel

vue

Gate DOM-dependent logic on isBooted

vue