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-hapticsnpx dissolve-ui add split-button --nativenpx shadcn@latest add https://dissolve.rselmi.com/r/native/split-button.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 split-button --webnpx shadcn@latest add https://dissolve.rselmi.com/r/split-button.jsonUsage
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' })}
/>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
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | required | Label of the whole button. |
cancelLabel | string | 'Cancel' | Left half once split. |
confirmLabel | string | 'Confirm' | Right half once split. |
onConfirm | () => void | required | Runs on the right half, then the halves fuse back. |
height | number | 52 | Button height. |
gap | number | 28 | Space between the two halves once split. The neck snaps at 80 percent of it. |
duration | number | 620 | Split duration, ms. |
haptics | boolean | true | Selection tick on taps, warning on confirm. |
className | string | Root: margins, width. The drop reads the danger tokens, the Cancel half surface-2. | |
labelClassName | string | 'text-base font-semibold' | Every label: size, weight. |
cancelLabelClassName | string | 'text-dissolve-foreground' | Cancel label, its color. |
Source
- React Native: registry/split-button.tsx
- React: registry/web/split-button.tsx and registry/web/split-button.core.ts
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.