SlideToConfirm

SlideToConfirm is an animated slide to confirm component for React Native and React, from the dissolve library. Slide to pay or confirm, shimmer label, loader, done state.

Slide to pay or confirm, like Apple Pay or power off. A light shimmer runs across the label, the track fills behind the knob, and past the threshold it locks, loads, then confirms.

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-haptics
npx dissolve-ui add slide-to-confirm --native
npx shadcn@latest add https://dissolve.rselmi.com/r/native/slide-to-confirm.json

React

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 slide-to-confirm --web
npx shadcn@latest add https://dissolve.rselmi.com/r/slide-to-confirm.json

Usage

SlideToConfirm.tsx (React Native)
import { SlideToConfirm } from '@/components/dissolve/slide-to-confirm';

<SlideToConfirm
  label="Slide to pay 42 €"
  doneLabel="Paid"
  onConfirm={() => pay(order)} // the knob shows a loader until the promise settles
/>
SlideToConfirm.tsx (React)
import { SlideToConfirm } from '@/components/dissolve/slide-to-confirm';

<SlideToConfirm
  label="Slide to pay 42 €"
  doneLabel="Paid"
  onConfirm={() => pay(order)} // the knob shows a loader until the promise settles
/>

Props

PropTypeDefaultDescription
labelstringrequiredLabel on the track, with a shimmer running across it.
onConfirm() => Promise | voidrequiredRuns once the knob reaches the end. The knob shows a loader until the promise settles; a rejection goes back to idle.
doneLabelstring'Done'Label once confirmed.
heightnumber60Track height. The knob is 10 points smaller.
thresholdnumber0.88Fraction of the track to reach before release confirms. A flick past halfway confirms too.
resetAfternumber1600Time on the done state before the slider resets, ms. 0 stays done.
hapticsbooleantrueMedium impact on lock, success when done.
classNamestring'rounded-full bg-dissolve-surface'Track: background, radius, margins. Fill, label and done state read the primary, muted and success tokens.
knobClassNamestring'rounded-full shadow-md'Knob: shadow, extra layout. Its color is animated from the primary token.

Source

Previous: GooeyMenu · Next: OTPInput · All components

dissolve is MIT licensed. Source on GitHub, package on npm. This page as markdown. For AI agents: llms.txt.