MorphButton

MorphButton is an animated morph button component for React Native and React, from the dissolve library. Dynamic Island style pill that folds into a loader, then opens as the done state.

A button that morphs like the Dynamic Island: the pill folds into a round loader, then opens back up as the done state. Crisp shape, a critically damped spring, content that cross-fades and scales.

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

Usage

MorphButton.tsx (React Native)
import { MorphButton } from '@/components/dissolve/morph-button';

<MorphButton
  label="Pay 42 €"
  doneLabel="Paid"
  onPress={() => pay(order)} // stays loading until the promise settles
/>
MorphButton.tsx (React)
import { MorphButton } from '@/components/dissolve/morph-button';

<MorphButton
  label="Pay 42 €"
  doneLabel="Paid"
  onPress={() => pay(order)} // stays loading until the promise settles
/>

Props

PropTypeDefaultDescription
labelstringrequiredIdle label.
doneLabelstring'Done'Label next to the check once the promise resolves.
onPress() => Promise | voidrequiredRuns on press. The button stays in its loading state until the promise settles; a rejection goes back to idle.
heightnumber52Pill height, also the loader diameter.
resetAfternumber1800Time spent on the done state before going back, ms. 0 stays done.
hapticsbooleantrueLight impact on press, success when done.
classNamestringOuter box (width, margins). The pill is centered inside it.
labelClassNamestring'text-base font-semibold text-dissolve-primary-foreground'Label and done label: size, weight, color. The pill reads the primary and success tokens.

Source

Previous: LikeButton · Next: SplitButton · All components

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