SweepTransition
SweepTransition is an animated sweep transition component for React Native and React, from the dissolve library. A crisp liquid band sweeps across a view and leaves the new state behind it.
Wrap any view and call run() with your state change. The current view is captured, the new state mounts under it, and a 28 pt band sweeps across the capture, bending what it passes with a light refraction, a hint of RGB split and a 1 pt accent rim. Vertical, horizontal, or a circle growing from a touch point. cancel() sends the band back and restores the old state. No blur.
Install
React Native
Install the engine once per app and wrap the root layout in <DissolveProvider> (see Installation), then copy the component into components/dissolve:
npx expo install dissolve-ui @shopify/react-native-skia react-native-reanimated react-native-worklets react-native-gesture-handler expo-hapticsnpx dissolve-ui add sweep-transition --nativenpx shadcn@latest add https://dissolve.rselmi.com/r/native/sweep-transition.jsonReact
Needs React 19 and react-dom, nothing else: no engine, no provider, no Tailwind. Works in the Next.js App Router.
npx dissolve-ui add sweep-transition --webnpx shadcn@latest add https://dissolve.rselmi.com/r/sweep-transition.jsonUsage
import { useRef } from 'react';
import { SweepTransition, type SweepTransitionHandle } from '@/components/dissolve/sweep-transition';
const sweep = useRef<SweepTransitionHandle>(null);
<SweepTransition ref={sweep} mode="vertical" className="rounded-3xl">
<PlanCard plan={plan} />
</SweepTransition>
sweep.current?.run(() => setPlan('pro'), { revert: () => setPlan('free') });import { useRef } from 'react';
import { SweepTransition, type SweepTransitionHandle } from '@/components/dissolve/sweep-transition';
const sweep = useRef<SweepTransitionHandle>(null);
<SweepTransition ref={sweep} mode="vertical" className="rounded-3xl">
<PlanCard plan={plan} />
</SweepTransition>
sweep.current?.run(() => setPlan('pro'), { revert: () => setPlan('free') });Props
| Prop | Type | Default | Description |
|---|---|---|---|
mode | 'vertical' | 'horizontal' | 'radial' | 'vertical' | Bottom to top, left to right, or a circle from the origin. |
duration | number | 720 | Sweep length in ms, calm curve. |
bandWidth | number | 28 | Width of the refractive band. |
ref.run | (apply, { origin?, mode?, revert? }) => Promise<void> | Captures the view, runs apply under the capture, then sweeps it away. origin is the radial center in local points. | |
ref.cancel | () => void | Sends the front back in 300 ms, then calls the run revert to put the old state back. | |
ref.running | () => boolean | True while a sweep is on screen. | |
haptics | boolean | true | Light at start, soft when the front passes half. |
className | string | Classes of the wrapper. | |
children | ReactNode | required | The view that changes. |
Source
- React Native: registry/sweep-transition.tsx
- React: registry/web/sweep-transition.tsx and registry/web/sweep-transition.core.ts
Previous: ImageReveal · Next: UploadTile · All components
dissolve is MIT licensed. Source on GitHub, package on npm. This page as markdown. For AI agents: llms.txt.