Button to Loader to Success Morph
A Book Now button in a bottom bar shrinks into a circle with a spinning arc, then a panel rises above the bar as the button widens to Go to checkout and a ring sweeps round a check. The panel then collapses back. A 4.8-second loop in react-native-svg.
export function Example() {
const progress = useSharedValue(0);
…
Agent prompt
Add the Now In Code component "button-to-loader-to-success-morph" to this project. The full source is attached at the end of this prompt. Put the files under components/button-to-loader-to-success-morph/, install the listed dependencies with `npx expo install`, and render it on a route I can open. Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply. === Source files are attached here for paid plans ===
Details
- Platforms
- iOS, Android
- Requires
- Expo SDK 54+
- Access
- Pro
- Updated
- 25 Sep 2026
- License
- Unlimited commercial projects
- Original design
- X
Are you the designer? Ask us to change or remove this.
Add pieces from the terminal or let your agent fetch them. Until then, Copy prompt does the same job. Docs
What it does
A full-bleed portrait photo with a dark gradient and a bottom bar holding a small avatar and a wide white booking button. Pressing the button makes it contract from full width toward a circle, the label disappears and a spinner arc starts turning inside it. After a short wait the spinner resolves into a check mark that is wiped in diagonally, with an outer ring arc drawing around it. The check holds, then the button expands back to its wide shape and the label returns. The sequence repeats about every five seconds automatically, and pressing the button replays it.
How it's built
A frame module computes the button width, label opacity, spinner angle and check progress for any time, using cubic-bezier curves fitted to the reference and a hold phase. The React Native component draws the spinner arc, ring arc and the diagonally revealed check live with react-native-svg, using a clip path for the wipe, with the gradient overlay also in SVG. A requestAnimationFrame loop advances time, a Pressable restarts it, and the photo is an Image. There are no pre-rendered frame strips.
Good for
- A booking, purchase or add-to-cart button that needs visible loading and success states
- A form submit button that turns into a spinner and then a check
- Any action where the same button should communicate progress
Dependencies
react-native-svgreact-native