Shader Transition
betaTransitions a frame between two states under a full-frame WebGL reveal — one raw-WebGL engine and sixteen presets (aperture, chroma, prism, SDF blobs and circles, noise, wipe, stripes, spiral…).
- Effects & motion
- 3 files
- No extra npm packages
- Accessibility notes
- Renders with WebGL
pnpm dlx @dowel-ui/cli add shader-transitionNo npm packages are needed beyond what Dowel already requires.
import { ShaderTransition } from "@/components/ui/shader-transition";Default
Gallery
Keyed
Custom Tokens
<ShaderTransition>
| Prop | Type | Default |
|---|---|---|
accentColour token of the glow on the moving front. Default "primary". | string | "primary" |
accentSecondaryColour token the preset's sheen tints the cover with. Default: accent mixed into surface. | string | — |
activeTwo-state API: which state is shown. Changing it runs the transition. | boolean | false |
durationRun length in ms at --motion-scale 1. Defaults to the preset's. | number | — |
fromTwo-state API: shown while | ReactNode | — |
onRestCalled when a run settles, however it ran. | () => void | — |
onStartCalled when a run starts. | () => void | — |
onSwapCalled when the incoming state becomes visible (the midpoint, or at once without motion). | () => void | — |
presetThe reveal pattern. Default "noise". | ShaderTransitionPresetName | "noise" |
surfaceColour token of the cover — the surface behind the content. Default "background". | string | "background" |
toTwo-state API: shown while | ReactNode | — |
transitionKeyKeyed API: changing the key runs the transition to the new children. | string | number | — |
children | ReactNode | — |
Plus every attribute of <div> except children.
8/9
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — fails
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes