GlowButton
A bottom action button for payment-style flows. The screen blurs, a soft colour glow drifts where the button was while your work runs, then it surges up over the screen and reveals a success state.
Preview
Preview coming soon
Try it live: run the CLI command below in an Expo app, or open the Code tab.
Installation
npx @codewithrabby/ui@latest add glow-buttonUsage
import { GlowButton } from "@/components/uir/glow-button";
<View style={{ flex: 1, backgroundColor: "#151515" }}>
{/* your screen content */}
<GlowButton
label="Continue"
loadingLabel="Topping up wallet"
doneLabel="Wallet topped up"
bottomInset={insets.bottom}
onPress={() => api.topUp(amount)} // glow runs until this resolves
onError={(e) => toast.error("Top-up failed")}
onDismiss={() => router.back()}
// colors={["#06b6d4", "#3b82f6", "#a855f7"]}
/>
</View>Props
| Prop | Type | Default |
|---|---|---|
labelButton text. | string | — |
onPressThe work to do. The glow runs until the promise settles. | () => void | Promise<void> | — |
loadingLabelShown in the middle of the screen while loading. | string | "Processing" |
doneLabelShown on the success screen. | string | "Done" |
doneContentReplace the success screen's content. | ReactNode | — |
onDismissTapping the success screen calls this and resets the button. | () => void | — |
onErrorCalled if onPress throws. The glow fades and the button comes back. | (error) => void | — |
minDurationKeep the glow up at least this long (ms). | number | 1500 |
colorsGlow colours, left to right. Any number. | string[] | purple, pink, orange, cream |
backgroundColorSuccess screen background. Match your screen. | string | "#151515" |
buttonColorButton background. | string | "#ffffff" |
buttonTextColorButton text colour. | string | "#111111" |
bottomInsetExtra space under the button, e.g. the safe-area bottom. | number | 0 |