@neshel-ui/animations/page-transitions
Every export of @neshel-ui/animations/page-transitions, generated from its declarations.
Experimental and not on npm
Signatures, members and defaults, generated from the built declarations. For explanations and examples read the guide.
PageTransitioncomponentBoundary around route content: React `<ViewTransition>` with `neshel-pt-<effect>` (PT01, PT03–PT06).
({ effect, asChild, children, ...rest }: PageTransitionProps): ElementPersistentElementcomponentPT08: an element that stays in place (no motion, no cross-fade) while the page changes.
(props: NamedProps): ElementRouteProgresscomponentPT07: indeterminate, accessible navigation progress (never a fake percentage).
({ pending, failed, navigation, onTimeout, delay, minVisible, timeout, announce, labels, className, ref, ...rest }: RouteProgressProps): ElementSharedElementcomponentPT02: an element that morphs into the element with the same name on the next route.
(props: NamedProps): ElementcreateRouteProgressfunction(element: HTMLElement, options?: RouteProgressOptions | undefined): RouteProgressenableCrossDocumentTransitionsfunctionReturns the disposer; a no-op where cross-document transitions are unsupported.
(options?: CrossDocumentOptions | undefined): () => voidgetReactViewTransitionfunctionReact's `ViewTransition` when this React exports it (19.3+), else `undefined`.
(): ViewTransitionComponent | undefinedgetViewTransitionSupportfunctionCurrent capabilities (computed on every call: cheap, and test/polyfill friendly).
(): ViewTransitionSupportregisterSharedElementfunctionRegister an element under a shared name; returns the unregister function.
(element: Element, name: string, options?: { persist?: boolean | undefined; } | undefined): () => voidstartPageTransitionfunction(update: () => void | Promise<void>, options?: PageTransitionOptions | undefined): PageTransitiontrackNavigationDirectionfunction(options?: { onChange?(direction: NavigationDirection, type: NavigationType): void; } | undefined): DirectionTrackeruseNavigationDirectionfunctionPT04: the last navigation's direction (state changes only on navigation).
(): { direction: NavigationDirection; type: NavigationType; }usePageTransitionfunctionRouter-free page transitions: `start(update, options)` runs `update` (a state change) inside a React Transition with transition types when React manages view transitions, so React captures the real commit; otherwise inside `startPageTransition`, whose update resolves at the next commit of the component that called this hook (its layout effect) — or after `maxWait`, when the browser stops holding rendering.
(): { start(update: () => void, options?: StartOptions | undefined): void; }useRouteTransitionfunctionRouter-independent contract (PT10): coordinates with the COMMITTED location (a layout effect after React committed the new route, never a click), moves focus only after a push/replace commit to an element the application marked, and reports the direction. Never intercepts links or history events.
({ location, type, focus }: RouteTransitionInput): { direction: NavigationDirection; }DIRECTION_ATTRIBUTEconst"data-neshel-pt-direction"EFFECT_ATTRIBUTEconst"data-neshel-pt-effect"PAGE_EFFECTSconstreadonly PageEffect[]CrossDocumentOptionsinterfaceCrossDocumentOptions
CrossDocumentOptions Prop Type Default Description effect PageEffect— — DirectionTrackerinterfaceDirectionTracker
DirectionTracker Prop Type Default Description destroy(required) () => void— — direction(required) NavigationDirection— — set(required) (direction: NavigationDirection, type?: NavigationType) => void— Router-provided direction (when the Navigation API is unavailable or the router knows better). type(required) NavigationType— — PageTransitionControlinterfacePageTransitionControl
PageTransitionControl Prop Type Default Description direction(required) NavigationDirection— — finished(required) Promise<PageTransitionResult>— Resolves when everything is cleaned up; rejects only when the update failed. native(required) boolean— — skip(required) () => void— — state(required) PageTransitionState— — updated(required) Promise<void>— Resolves when the update ran (rejects with its error). PageTransitionOptionsinterfacePageTransitionOptions
PageTransitionOptions Prop Type Default Description direction NavigationDirection | "auto"— — effect PageEffect— — fallback "none" | "flip""none"Shared elements without the API: FLIP from the old box (default "none").maxWait number— ms the browser may hold rendering for the update (0–10000, default 1500). reducedMotion ReducedMotion— — scope Element— Element whose content changes (default: the document root). types readonly string[]— — PageTransitionPropsinterfacePageTransitionProps
PageTransitionProps Prop Type Default Description asChild boolean— — children ReactNode— — effect PageEffect"fade"Effect of the route content (default "fade").ref Ref<HTMLDivElement>— — Also accepts the props of: React DOM attributes.
PageTransitionResultinterfacePageTransitionResult
PageTransitionResult Prop Type Default Description direction(required) NavigationDirection— — native(required) boolean— — status(required) "completed" | "skipped" | "interrupted"— — RouteProgressControlinterfaceRouteProgressControl
RouteProgressControl Prop Type Default Description cancel(required) () => void— — destroy(required) () => void— — done(required) () => void— — fail(required) () => void— — start(required) () => void— — state(required) RouteProgressState— — RouteProgressOptionsinterfaceRouteProgressOptions
RouteProgressOptions Prop Type Default Description announce booleanfalseAnnounce completion/failure once in a status region (default false). delay number— ms before the bar appears (0–2000, default 120). labels Partial<Record<"loading" | "loaded" | "failed", string>>— — minVisible number— ms the completed/failed state stays visible (0–3000, default 300). onTimeout () => void— Called when the watchdog cancels a navigation that never settled (the owner should clear its state). timeout number— ms after which a pending navigation is cancelled (1000–120000, default 15000). RouteProgressPropsinterfaceRouteProgressProps
RouteProgressProps Prop Type Default Description announce booleanfalseAnnounce completion/failure once in a status region (default false). delay number— ms before the bar appears (0–2000, default 120). failed boolean— The last navigation failed (shown when pendingturns false).labels Partial<Record<"loading" | "loaded" | "failed", string>>— — minVisible number— ms the completed/failed state stays visible (0–3000, default 300). navigation string | number— Identity of the current navigation: a new value while still pending restarts the indicator. onTimeout () => void— Called when the watchdog cancels a navigation that never settled (the owner should clear its state). pending(required) boolean— The router's real pending state. ref Ref<HTMLDivElement>— — timeout number— ms after which a pending navigation is cancelled (1000–120000, default 15000). Also accepts the props of: React DOM attributes.
RouteTransitionInputinterfaceRouteTransitionInput
RouteTransitionInput Prop Type Default Description failed boolean— — focus "auto" | "none""auto"After a committed push/replace, focus [data-neshel-route-focus](default"auto").location(required) string— Committed location (pathname + search, or a router key). pending boolean— The router's real navigation state. type NavigationType— — StartOptionsinterfaceStartOptions
StartOptions Prop Type Default Description direction NavigationDirection | "auto"— — effect PageEffect— — fallback "none" | "flip""none"Shared elements without the API: FLIP from the old box (default "none").maxWait number— ms the browser may hold rendering for the update (0–10000, default 1500). native boolean— Force the framework-free controller even when React manages view transitions. reducedMotion ReducedMotion— — scope Element— Element whose content changes (default: the document root). types readonly string[]— — ViewTransitionSupportinterfaceViewTransitionSupport
View Transition capability detection (Phase 013; contracts/page-transitions.md §2, research R1–R3). Behavioural checks per capability, never user-agent sniffing; all
falseon the server.ViewTransitionSupport Prop Type Default Description classes(required) boolean— view-transition-class.crossDocument(required) boolean— Cross-document transitions ( @view-transition,pagereveal).navigationApi(required) boolean— Navigation API with history entry indexes (direction detection). sameDocument(required) boolean— document.startViewTransition(same-document transitions).types(required) boolean— Transition types ( :active-view-transition-type(),{ types }).NavigationDirectiontypePT04 — Navigation direction (contracts/page-transitions.md §4, research R3). With the Navigation API, every `navigate` event decides the direction from history entry indexes (never from URLs): push → forward, replace/reload → replace, traverse → back or forward by comparing `destination.index` with `currentEntry.index`. The tracker writes `data-neshel-pt-direction` on `<html>` synchronously in the event — before any router updates the DOM — so CSS and React's own view transitions see it. A `replace` to the current URL is router state bookkeeping and leaves the direction alone. Without the API, routers may call `set()`; otherwise the direction stays `"unknown"` and direction-aware effects use their neutral variant. One shared listener, reference-counted.
"forward" | "back" | "replace" | "unknown"NavigationTypetype"push" | "replace" | "traverse" | "reload" | "unknown"PageEffecttype"fade" | "slide" | "scale" | "wipe" | "none"PageTransitionStatetype"pending" | "updating" | "animating" | "completed" | "skipped" | "interrupted" | "failed"RouteProgressStatetype"idle" | "pending" | "complete" | "failed"