View transitions
ViewTransitions
Factory components that set viewTransitionName for shared-element transitions across navigations.
ViewTransitions
Namespace of element helpers — each key is a standard HTML tag. Every component requires a stable name string that matches between the outgoing and incoming route.
import React from 'react';
import { , } from 'manicjs';
export function ({ , , }: { : string; : string; : string }) {
return (
< ={`/products/${}`}>
<. ={`product-${}`} src={} ={} /> <. ={`product-title-${}`}>{}</.>
</>
);
}Supported tags
| Group | Elements |
|---|---|
| Layout | div, span, main, section, article, header, footer, nav, aside |
| Headings | h1, h2, h3 |
| Content | p, img, button, a, ul, li |
Props
Each helper forwards native DOM props except it injects style.viewTransitionName from name.
Prop
Type
CSS customization
::view-transition-old(root),
::view-transition-new(root) {
animation-duration: 240ms;
}Browser support
When document.startViewTransition is missing, Manic swaps routes instantly — no runtime errors.