SplitButton

SplitButton is an animated split button component for React Native and React, from the dissolve library. Splits in two like a drop of liquid metal, Cancel and Confirm halves.

A button that divides in the middle like a drop of liquid metal: the two halves pull apart, a neck between them thins into a waist, then snaps. Cancel fuses them back. Vector edges, no blur, so it stays crisp.

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 split-button --native
npx shadcn@latest add https://dissolve.rselmi.com/r/native/split-button.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 split-button --web
npx shadcn@latest add https://dissolve.rselmi.com/r/split-button.json

Usage

SplitButton.tsx (React Native)
import { SplitButton } from '@/components/dissolve/split-button';
import { useToast } from '@/components/dissolve/toast';

const toast = useToast();

<SplitButton
  label="Delete project"
  confirmLabel="Delete"
  onConfirm={() => toast.show({ title: 'Project deleted', tone: 'error' })}
/>
SplitButton.tsx (React)
import { SplitButton } from '@/components/dissolve/split-button';
import { useToast } from '@/components/dissolve/toast';

const toast = useToast();

<SplitButton
  label="Delete project"
  confirmLabel="Delete"
  onConfirm={() => toast.show({ title: 'Project deleted', tone: 'error' })}
/>

Props

PropTypeDefaultDescription
labelstringrequiredLabel of the whole button.
cancelLabelstring'Cancel'Left half once split.
confirmLabelstring'Confirm'Right half once split.
onConfirm() => voidrequiredRuns on the right half, then the halves fuse back.
heightnumber52Button height.
gapnumber28Space between the two halves once split. The neck snaps at 80 percent of it.
durationnumber620Split duration, ms.
hapticsbooleantrueSelection tick on taps, warning on confirm.
classNamestringRoot: margins, width. The drop reads the danger tokens, the Cancel half surface-2.
labelClassNamestring'text-base font-semibold'Every label: size, weight.
cancelLabelClassNamestring'text-dissolve-foreground'Cancel label, its color.

Source

Previous: MorphButton · Next: GooeyMenu · All components

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