Primitives
Animated Number Avatar Badge Button Button Group Toggle Toggle Group Checkbox Chip Countdown Divider Fab Grid Icon Image Input Search Input Textarea Label Loader Marquee Masked Input Message Bubble Notification Banner Offline Banner Progress Progress Ring Radio Group Range Slider Rating Separator Skeleton Slider Stack Stepper Switch Text Theme Toggle Ticker Typing IndicatorComposed
Accordion Achievement Badge Action Bar Action Sheet Action Swap Activity Rings Add to Cart Button Address Card Agenda List Alert Amount Keypad Animated Icons App Bar Audio Message Audio Recorder Autocomplete Avatar Group Balance Display Bar List Barcode Before After Biometric Gate Bloom Menu Bottom Sheet Paywall Sheet Side Sheet Breadcrumb Calendar Calendar Strip Card Carousel Cart Item Character Charts Chat Composer Chat List Item Choice Card Circle Reveal Coach Marks Collapsible Collapsible Header Color Picker Combobox Command Palette Comment Thread Confetti Consent Sheet Context Menu Copy Field Country Picker Coupon Input Currency Input Data Table Date Range Picker Day Schedule Dialog Dock Donut Chart Drawer Driver Card Dropdown Menu Drum Picker Emoji Picker Empty State Error State Event Card Expandable Control Fader Feature Gate File Picker Filter Bar Follow Button Form Gauge Glass Glass Cluster Glass Dock Morph Glass Fab Morph Glass Lab Glass Orb Glass Search Morph Glass Sheet Edge Gradient Button Headline New Heatmap Image Cropper Image Viewer Kanban Card Keyboard Avoiding Keyboard Toolbar Leaderboard Level Progress Lightbox Like Button Line Chart List Reorderable List Swipeable Row Location Card Location Search Map Sheet Map View Markdown View Media Controls Media Picker Media Tile Mention Input Meter Bar Mini Player Mood Slider Morphing Modal Multi Select Navigation Rail Notification Item Number Input Onboarding Pager Order Card Order Summary OTP Input Pagination Paper Clip New Parallax Header Pass Card Password Strength Payment Button Payment Card Payment Method Permission Primer Phone Input PIN Pad Polaroid New Poll Popover Post Card Postage Stamp New Price Tag Pricing Table Product Card Product Gallery Profile Header Promo Banner Prompt Input Property Card Pull To Refresh QR Code Quick Actions Quick Replies Rating Summary Reaction Picker Resend Timer Review Card Review Prompt Ride Option Save Button Scan Frame Scroll Spy Tabs Seat Map Section Header Section Index Segmented Control Select Share Button Share Sheet Shutter Button Signature Pad Slide to Confirm Slot Picker Smart Banner Social Login Button Sparkline Splash Screen Split Button Stat Card Stateful Button Status Dot Step Flow Steps Sticker New Stopwatch Stories Progress Stories Viewer Story Ring Streak Counter Streaming Text Success Seal Swipe Deck Tabs Tag Input Tape New Text Reveal Thinking Indicator Time Picker Timeline Timer Ring Tip Selector Toast Toolbar Tooltip Track Row Transaction Row Trip Progress Variant Picker Video Controls Waveform Weather Card Weekday Picker Zoom TransitionScreens
Account Switcher Biometric Setup Delete Account Forgot Password Grow Auth Login Login — Dark Stage Login — Dense Work Login — Editorial Login — Illustrated Login — Minimal Ink Login — Social Login — Video Loop Food Onboarding Onboarding Onboarding Dark Objects Onboarding Editorial Onboarding Illustrated Onboarding Personalize Onboarding Photo Carousel OTP Verification Passkey — Create Password Reset Permission — Notifications Phone Verification Onboarding Quiz Session Devices Signup Sign-up Chat Sign-up Photo Sheet Social Auth Split Auth Verify Identity Welcome AI Chat AI Assistant Channels List Chat Info Chat List Chat Media Chat Thread Create Group Group Info Message Requests New Message Kept Messages Accessibility Activity Log Appearance Authenticator Blocked Accounts Export Your Data Downloads Edit Profile Edit Profile — Rows Emergency Call Empty States Set Error State Send Feedback Device Locator Help Center Home — Bento Home — Dark Home — Editorial Home Feed Invite Friends Language & Region Linked Accounts Not Found (404) Notification Settings Notifications Password Vault Paywall Paywall — Comparison Paywall — Dark Stage Paywall — Editorial Paywall — Photo Paywall — Trial Timeline Privacy Profile Profile — Gamified Profile — Minimal Profile — Photo Hero QR Scanner Report Issue Saved Items Phone Time Search Search — Command Palette Search — Visual Account Health Settings Settings — Dark Device Settings — Search Storage & Data Terms & Privacy Dating Chat Dating Filters Profile Discover Its A Match Into You Matches Profile Detail Profile Editor Courier Matching Delivery History Delivery Support Package Schedule Parcel Tracking Proof Of Delivery Quick Aisle Quick Home Send Package Substitutions Add Payment Address Book Cart Categories Checkout Checkout — Steps Checkout Success Delivery Filters & Sort Flash Sale Gift Cards Loyalty Points Order Cancel Order Detail Orders Pay Later Checkout Payment Methods Product Detail Product Detail — Hero Product Grid Product Reviews Promo Codes Recently Viewed Return Items Search Results Shop Assistant Store Home Tip & Rate Courier Order Tracking Wishlist Write a Review Event Checkin Event Hero Events Discover My Tickets Seat Selection Ticket Checkout Add Card Bank Accounts Dashboard — Bento Bill Pay Budgets Card Details Crypto Portfolio Finance Dashboard Dashboard — Dark Exchange Currency Expense List Invoice Detail Manage Cards Plan Management Savings Goals Send Money Spending Analytics Split Bill Subscriptions Token Detail Token Swap Transactions Wallet Home Wallet Movers Courier Tracking Food Cart Food Home Food Orders Grocery List Recipe Detail Restaurant — Dark Restaurant Detail Activity Rings Fitness Home Habit Quest Habit Tracker Meal Planner Med Store Meditation Player Mood Check-in Nutrition Home Period Tracker Prior Auth Prior Auth Cases Quest Complete Run Tracking Rx Scan Sleep Tracker Telehealth Booking Walk Map Water Tracker Workout Complete Workout Detail Workout Session Applications Apply Company Interview Schedule Job Detail Job Feed Resume Saved Jobs Create Listing Item Chat Listing Detail Make Offer Market Checkout Market Home Market Search My Listings Offers Inbox Seller Profile Audiobook Player Camera Gallery Albums Game Store Mini Player Music Player Photo Editor Photo Gallery Playlist Detail Podcast Player Clips Feed Serene Home Sound Mixer Stories Video Call Video Player Article Reader Course Detail Event Detail Memory Onboarding Icon Lab Leaderboard Lesson Player Match Detail News Editorial News Home Plant Care Prediction Live Prediction Welcome Smart Home Standings Ticket Wallet Topics Follow Weather Detail Add Task Sheet Alarm Clock Calendar Day Calendar Month Doc Scanner File Manager Focus Timer Journal Kanban Board Mail Inbox Mail Thread Note Editor Notes List Reminders Task List Time Blocks Agent Profile Compare Homes Mortgage Calculator Property Detail Rental Application Saved Homes Schedule Tour Search List Search Map Complete Destination Driver Arriving Ev Charging History Home In Trip Matching Options Parking Receipt Safety Schedule Scooter Unlock Booking Confirmed Booking Review Booking Slots My Bookings Pro On The Way Provider Detail Provider List Rate Service Services Home Arc Create Arc Detail Arc Onboarding Avatar Creator Comments Sheet Create Post Explore Grid Followers List Hashtag Feed Mentions Post Detail Post Hero Social Profile Boarding Pass Booking Confirm Car Rental Trip Discover Flight Live Flight Preferences Flight Results Flight Search Hotel Detail Live Transit Trip — Map Day Trip — Rideshare Request Seat Select Travel Home Trip Itinerary Trip OnboardingNothing matches — try another word.
Success Seal
Success moment that stamps a seal onto the receipt, ticket or card that was just paid. Also works as a standalone hero above a title, and shows a clear cross on a decline.
Preview
import * as React from "react";
import { forwardRef } from "react";
import { Text, View, type ViewProps } from "react-native";
import Animated, {
Easing,
useAnimatedProps,
useAnimatedStyle,
useSharedValue,
withDelay,
withSequence,
withSpring,
withTiming,
} from "react-native-reanimated";
import Svg, { Path } from "react-native-svg";
import {
AnimatedPath,
LightPool,
cn,
createVariant,
ease,
spring,
tempo,
timing,
useHaptic,
useReducedMotion,
useTheme,
type ColorTokens,
} from "@lumioui/core";
export type SuccessSealSize = "md" | "lg" | "xl";
export type SuccessSealTone = "success" | "primary" | "destructive" | "warning";
/** Drawing space — the seal is authored on a 200 x 200 grid. */
const VIEW = 200;
const CENTER = VIEW / 2;
/** Scalloped silhouette: base radius + a 12-lobe cosine ripple, filling the grid. */
const LOBES = 12;
const SEAL_R = 88;
const SEAL_RIPPLE = 7;
const SEAL_STEPS = 144;
/** Seal diameter per size, as a hero. */
const HERO_PX: Record<SuccessSealSize, number> = { md: 92, lg: 116, xl: 144 };
/** Seal diameter per size, stamped onto a card corner. */
const STAMP_PX: Record<SuccessSealSize, number> = { md: 56, lg: 68, xl: 80 };
/** The glyph draws on just after contact, inside the UI band. */
const DRAW = { duration: tempo.move, easing: Easing.bezier(...ease.out) };
/** A stamp arrives slightly oversized and translucent, then presses down. */
const STAMP_FROM = 1.12;
/** Act, hold, resolve (DESIGN-TASTE §5c rule 5): the stamped object is left to be read. */
const HOLD_MS = 700;
const TONES: Record<SuccessSealTone, { fill: keyof ColorTokens; glyph: keyof ColorTokens; label: string }> = {
success: { fill: "success", glyph: "successForeground", label: "Success" },
primary: { fill: "primary", glyph: "primaryForeground", label: "Done" },
destructive: { fill: "destructive", glyph: "destructiveForeground", label: "Failed" },
warning: { fill: "warning", glyph: "warningForeground", label: "Attention" },
};
/** Check mark and (for destructive) cross — drawn on via strokeDashoffset. */
const CHECK_PATH = "M70 104 L92 126 L134 80";
const CHECK_LEN = 94;
const CROSS_PATH = "M76 76 L124 124 M124 76 L76 124";
const CROSS_LEN = 136;
/** Built once — the lobed outline never changes. */
const SEAL_D = (() => {
let d = "";
for (let i = 0; i <= SEAL_STEPS; i++) {
const t = (i / SEAL_STEPS) * Math.PI * 2;
const r = SEAL_R + SEAL_RIPPLE * Math.cos(LOBES * t);
const x = CENTER + r * Math.sin(t);
const y = CENTER - r * Math.cos(t);
d += `${i === 0 ? "M" : "L"}${x.toFixed(2)} ${y.toFixed(2)} `;
}
return `${d}Z`;
})();
const titleVariants = createVariant({
base: "text-center font-semibold tracking-tight text-foreground",
variants: {
size: {
md: "text-xl",
lg: "text-2xl",
xl: "text-3xl",
},
},
defaultVariants: { size: "lg" },
});
export interface SuccessSealProps extends Omit<ViewProps, "className" | "children"> {
/** Seal size. Default "lg". */
size?: SuccessSealSize;
/** Colour story. "destructive" swaps the check for a cross and refuses with a flicker. Default "success". */
tone?: SuccessSealTone;
/** Play the choreography. Default true. */
animated?: boolean;
/**
* Stamp mode: the object that was paid, sent or signed. The seal presses
* onto its corner, the object dips under it as light pools behind, then
* holds. Without children the seal is a hero above `title`.
*/
children?: React.ReactNode;
/** Stamp mode: lands when this turns true. Default true (lands on mount). */
on?: boolean;
/** Stamp mode: corner radius of the stamped object (its clip). Default 24. */
radius?: number;
/** Headline under the seal (hero mode). Pass nested <Text> to emphasise an amount. */
title?: React.ReactNode;
/** Supporting line under the headline (hero mode). */
description?: React.ReactNode;
/** Fires once the result has landed and held (immediately when not animated). */
onSettled?: () => void;
/** Land a notification haptic at contact. Default true. */
haptic?: boolean;
className?: string;
}
/**
* SuccessSeal — the result lands on the thing it is about.
*
* Stamp mode (preferred): wrap the receipt, ticket or card that was just paid
* or sent. The seal presses onto its top corner, the object dips under the
* contact while its accent light pools behind (nothing sweeps across it), and it
* holds 700ms before `onSettled` — the screen resolves around it.
* <SuccessSeal on={paid}><InvoiceCard /></SuccessSeal>
*
* Hero mode: the seal lands in its own pool of light above a title.
* <SuccessSeal title="Payment sent" description="You sent $1,000.00" />
*
* Destructive never celebrates: the object flickers once and the cross draws.
* Reduced motion keeps the fades and the light, drops the press and travel.
*/
export const SuccessSeal = forwardRef<React.ElementRef<typeof View>, SuccessSealProps>(function SuccessSeal(
{
size = "lg",
tone = "success",
animated = true,
children,
on = true,
radius = 24,
title,
description,
onSettled,
haptic = true,
className,
...props
},
ref
) {
const { colors } = useTheme();
const reduce = useReducedMotion();
const haptics = useHaptic();
const t = TONES[tone];
const fill = colors[t.fill];
const glyph = colors[t.glyph];
const stamp = children != null;
const refuse = tone === "destructive";
const px = stamp ? STAMP_PX[size] : HERO_PX[size];
const land = useSharedValue(animated ? 0 : 1);
const press = useSharedValue(animated && !reduce ? STAMP_FROM : 1);
const draw = useSharedValue(animated && !reduce ? 0 : 1);
const dip = useSharedValue(0);
const flicker = useSharedValue(0);
const [lit, setLit] = React.useState(!animated);
const settledRef = React.useRef(onSettled);
settledRef.current = onSettled;
const notify = React.useCallback(() => settledRef.current?.(), []);
const go = animated && on;
React.useEffect(() => {
if (!animated) {
settledRef.current?.();
return;
}
if (!on) return;
const timers: ReturnType<typeof setTimeout>[] = [];
if (haptic) {
if (refuse) haptics.error();
else if (tone === "warning") haptics.warning();
else haptics.success();
}
land.value = withTiming(1, timing.fast);
if (reduce) {
draw.value = 1;
} else {
press.value = withSpring(1, spring.pop);
draw.value = withDelay(timing.fast.duration / 2, withTiming(1, DRAW));
if (refuse) {
flicker.value = withSequence(withTiming(1, timing.instant), withSpring(0, spring.shake));
} else if (stamp) {
dip.value = withSequence(withTiming(1, timing.instant), withSpring(0, spring.press));
}
}
if (!refuse) setLit(true);
timers.push(setTimeout(notify, stamp ? HOLD_MS : DRAW.duration + timing.fast.duration));
return () => timers.forEach(clearTimeout);
// The choreography runs once per landing.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [go]);
const sealStyle = useAnimatedStyle(() => ({
opacity: land.value,
transform: [{ scale: press.value }, { rotate: stamp ? "-10deg" : "0deg" }],
}));
const objectStyle = useAnimatedStyle(() => ({
transform: [{ scale: 1 - dip.value * 0.03 }, { translateX: flicker.value * 4 }],
}));
const glyphProps = useAnimatedProps(() => ({
strokeDashoffset: (1 - draw.value) * (refuse ? CROSS_LEN : CHECK_LEN),
}));
const label = typeof title === "string" ? title : t.label;
const seal = (
<Animated.View
pointerEvents="none"
accessible={!stamp}
accessibilityRole={stamp ? undefined : "image"}
accessibilityLabel={stamp ? undefined : label}
style={[{ width: px, height: px }, sealStyle]}
>
<Svg width={px} height={px} viewBox={`0 0 ${VIEW} ${VIEW}`}>
<Path d={SEAL_D} fill={fill} />
<AnimatedPath
d={refuse ? CROSS_PATH : CHECK_PATH}
fill="none"
stroke={glyph}
strokeWidth={14}
strokeLinecap="round"
strokeLinejoin="round"
strokeDasharray={refuse ? CROSS_LEN : CHECK_LEN}
animatedProps={glyphProps}
/>
</Svg>
</Animated.View>
);
if (stamp) {
return (
<View ref={ref} className={cn("w-full", className)} accessibilityLabel={on ? label : undefined} {...props}>
<LightPool on={lit && on} color={fill} size={360} strength={0.32} className="absolute -left-10 -top-16" />
<Animated.View style={objectStyle}>
<View style={{ borderRadius: radius, overflow: "hidden" }}>
{children}
</View>
</Animated.View>
{on ? <View className="absolute -right-3 -top-4">{seal}</View> : null}
</View>
);
}
return (
<View ref={ref} className={cn("items-center", className)} {...props}>
<View className="items-center justify-center" style={{ width: px * 2, height: px * 1.4 }}>
<LightPool on={lit && !refuse} color={fill} size={px * 2.6} strength={0.34} className="absolute self-center" />
<Animated.View style={objectStyle}>{seal}</Animated.View>
</View>
{title != null || description != null ? (
<View className="mt-2 max-w-[320px] items-center gap-1.5 px-4">
{title != null ? (
<Text
className={titleVariants({ size })}
style={{ fontVariant: ["tabular-nums"] }}
accessibilityRole="header"
accessibilityLiveRegion="polite"
>
{title}
</Text>
) : null}
{description != null ? (
<Text className="text-center text-base leading-snug text-muted-foreground" style={{ fontVariant: ["tabular-nums"] }}>
{description}
</Text>
) : null}
</View>
) : null}
</View>
);
});
SuccessSeal.displayName = "SuccessSeal"; import { SuccessSeal } from "@/components/ui/success-seal/success-seal";
export function Example() {
return (
<SuccessSeal />
);
} Installation
Install the dependencies
npx expo install react-native-reanimated react-native-svgCopy the source from the Code tab into your project
components/ui/success-seal/success-seal.tsxcomponents/ui/success-seal/index.tsUpdate the import paths to match your project setup.
Usage
import { SuccessSeal } from "@/components/ui/success-seal/success-seal"; <SuccessSeal /> Examples
Concert tickets at checkout.
import * as React from "react";
import { Text, View } from "react-native";
import { Button } from "../../button/button";
import { SuccessSeal } from "../success-seal";
/** SuccessSealDeclined — concert tickets at checkout. A decline never
* celebrates: the order card flickers once and a cross seal lands on it.
* Retrying with another card stamps the same card with the success seal. */
export function SuccessSealDeclined() {
const [state, setState] = React.useState<"declined" | "paid">("declined");
const paid = state === "paid";
return (
<View className="w-full gap-5">
<SuccessSeal key={state} tone={paid ? "success" : "destructive"} size="md" radius={28}>
<View className="bg-card p-5">
<Text className="text-sm text-muted-foreground">The Greek Theatre · Sat 18 Oct, 7:30 PM</Text>
<Text className="mt-1 text-2xl font-semibold tracking-tight text-foreground">2 × Phoebe Brennan</Text>
<Text className={paid ? "mt-2 text-[15px] font-semibold text-success" : "mt-2 text-[15px] font-semibold text-destructive"} accessibilityLiveRegion="polite">
{paid ? "Paid $148.50 · tickets in your Wallet" : "Visa ••2291 declined · nothing was taken"}
</Text>
</View>
</SuccessSeal>
{paid ? (
<Button size="lg" className="w-full">View tickets</Button>
) : (
<View className="gap-2">
<Button size="lg" className="w-full" onPress={() => setState("paid")}>
Pay with Mastercard ••8034
</Button>
<Button size="lg" variant="ghost" className="w-full">
Use another card
</Button>
</View>
)}
</View>
);
} A freelancer marks an invoice paid.
import * as React from "react";
import { Text, View } from "react-native";
import { Accent } from "@lumioui/core";
import { Button } from "../../button/button";
import { SuccessSeal } from "../success-seal";
/** SuccessSealPayment — a freelancer marks an invoice paid. The seal lands on
* the invoice itself: the card dips under the stamp, light pools behind it
* and it holds, then its status line resolves to "Paid". "Undo" lets you replay it. */
export function SuccessSealPayment() {
const [paid, setPaid] = React.useState(false);
const [settled, setSettled] = React.useState(false);
const [run, setRun] = React.useState(0);
return (
<Accent color="green" className="w-full">
<View className="w-full gap-5">
<SuccessSeal key={run} on={paid} onSettled={() => setSettled(true)} radius={28}>
<View className="bg-card px-5 pb-5 pt-5">
<Text className="text-sm text-muted-foreground">Invoice 0142 · Harlow & Pike Studio</Text>
<Text className="mt-1 text-[40px] font-semibold tracking-tight text-foreground" style={{ fontVariant: ["tabular-nums"] }}>
$3,240<Text className="text-2xl text-muted-foreground">.00</Text>
</Text>
<Text
className={settled ? "mt-1 text-[15px] font-semibold text-primary-text" : "mt-1 text-[15px] text-muted-foreground"}
accessibilityLiveRegion="polite"
>
{settled ? "Paid today · in your account Mon 13 Oct" : "Due Fri 17 Oct · 6 days"}
</Text>
<View className="mt-5 gap-3 border-t border-border pt-4">
{[
["Brand refresh — round 2", "$2,400.00"],
["Illustration set, 6 spots", "$840.00"],
].map(([item, amount]) => (
<View key={item} className="flex-row justify-between">
<Text className="text-[15px] text-foreground">{item}</Text>
<Text className="text-[15px] font-medium text-foreground" style={{ fontVariant: ["tabular-nums"] }}>
{amount}
</Text>
</View>
))}
</View>
</View>
</SuccessSeal>
{paid ? (
<Button
size="lg"
variant="secondary"
className="w-full"
onPress={() => {
setPaid(false);
setSettled(false);
setRun((r) => r + 1);
}}
>
Undo
</Button>
) : (
<Button size="lg" className="w-full" onPress={() => setPaid(true)}>
Mark as paid
</Button>
)}
</View>
</Accent>
);
} API reference
size SuccessSealSize Seal size. Default "lg".
"lg" tone SuccessSealTone Colour story. "destructive" swaps the check for a cross and refuses with a flicker. Default "success".
"success" animated boolean Play the choreography. Default true.
true children React.ReactNode Stamp mode: the object that was paid, sent or signed. The seal presses onto its corner, the object dips under it as light pools behind, then holds. Without children the seal is a hero above title.
on boolean Stamp mode: lands when this turns true. Default true (lands on mount).
true radius number Stamp mode: corner radius of the stamped object (its clip). Default 24.
24 title React.ReactNode Headline under the seal (hero mode). Pass nested <Text> to emphasise an amount.
—description React.ReactNode Supporting line under the headline (hero mode).
—onSettled () => void Fires once the result has landed and held (immediately when not animated).
—haptic boolean Land a notification haptic at contact. Default true.
true className string —