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.
Circle Reveal
Screen transition that floods the next screen’s colour out from the button you tapped, as a growing circle with a lit rim. Your app swaps screens under it and can move shared elements along.
Preview
import * as React from "react";
import { forwardRef } from "react";
import { View, type GestureResponderEvent, type LayoutChangeEvent, type ViewProps } from "react-native";
import Animated, {
Easing,
cancelAnimation,
runOnJS,
useAnimatedStyle,
useSharedValue,
withDelay,
withTiming,
type SharedValue,
} from "react-native-reanimated";
import { cn, ease, tempo, timing, useHaptic, useReducedMotion, useTheme } from "@lumioui/core";
/**
* CircleReveal — the "next screen floods out of the control you touched"
* transition. A solid circle of the next screen's background grows from an
* origin (a slide thumb, a theme button, a Place order CTA) until it covers
* the whole surface; `onCovered` is the moment to swap content underneath;
* then the circle dims away so the new content reads as igniting.
*
* const reveal = React.useRef<CircleRevealHandle>(null);
* <View className="flex-1">
* {screen === "cart" ? <Cart /> : <Confirmed />}
* <CircleReveal ref={reveal} color={colors.primary} onCovered={() => setScreen("confirmed")} />
* </View>
* <Button onPress={(e) => reveal.current?.reveal(e)}>Place order</Button>
*
* Or declaratively: `<CircleReveal active={open} origin={thumbEnd} onCovered={(open) => …} />`.
*
* The circle is ONE Animated.View of a fixed base diameter, grown by a
* UI-thread transform scale to exactly the radius that reaches the farthest
* corner from the origin (measured with onLayout) — no width/height
* animation, no JS per frame. `children` render ABOVE the circle so a shared
* element (the product photo) stays visible while the screen changes under
* it; pass a function to receive `revealed` (0 → 1 on reveal, 1 → 0 on
* conceal, in lock-step with the circle) and glide it between slots.
* The flood is light, not paint: its leading edge carries a lit 2pt rim
* that is brightest out of the touch and dims as the circle covers (the
* border is counter-scaled so it stays 2pt at any size). Land the next
* screen under a `LightFall` in the flood's hue so the light stays on it.
* Light haptic on start, selection tick when covered. Reduced motion swaps
* the growth for a plain colour crossfade (no rim). Expo Go compatible.
*/
export interface CircleRevealOrigin {
/** x in the overlay's own coordinates (pt). */
x: number;
/** y in the overlay's own coordinates (pt). */
y: number;
}
/** Where to grow from — local coordinates, or a press event (its
* pageX/pageY are converted into the overlay's coordinates). */
export type CircleRevealFrom = CircleRevealOrigin | GestureResponderEvent;
export interface CircleRevealHandle {
/** Grow the circle (default `color`) from `from`; fires onCovered(true). */
reveal: (from?: CircleRevealFrom, color?: string) => void;
/** Grow back the other way (default `concealColor`); fires onCovered(false). */
conceal: (from?: CircleRevealFrom, color?: string) => void;
/** Convert a press event / page point into overlay coordinates. */
toLocal: (pageX: number, pageY: number) => CircleRevealOrigin;
}
export interface CircleRevealProps extends Omit<ViewProps, "className" | "children"> {
/** Declarative trigger: false → true reveals, true → false conceals.
* Optional — the imperative ref handle works without it. */
active?: boolean;
/** Origin in the overlay's coordinates. Default bottom-centre. */
origin?: CircleRevealOrigin;
/** Reveal fill — the NEXT screen's background. Default theme background. */
color?: string;
/** Conceal fill — the PREVIOUS screen's background. Default `color`. */
concealColor?: string;
/** Reveal flood in ms. Default 315 (tempo.settle). */
duration?: number;
/** Conceal flood in ms. Default 250 — going back runs quicker than the
* commit. */
concealDuration?: number;
/** Circle fully covers the surface — swap content now. `revealed` is
* true after a reveal, false after a conceal. */
onCovered?: (revealed: boolean) => void;
/** The circle has faded away and the transition is complete. */
onDone?: (revealed: boolean) => void;
/** Lit leading rim on the flood's edge. Default true. */
rim?: boolean;
/** Rim light colour — brighter than the fill. Default soft white. */
rimColor?: string;
/** Rendered above the circle (shared elements). A function receives the
* `revealed` shared value, 0 → 1 on reveal and 1 → 0 on conceal. */
children?: React.ReactNode | ((revealed: SharedValue<number>) => React.ReactNode);
className?: string;
}
/** The flood — one tempo.settle from touch to farthest corner. */
const REVEAL_MS = tempo.settle;
/** Going back is a retreat, so it runs at ~80% of the commit. */
const CONCEAL_MS = tempo.move;
/** Once covered, the circle dims away over timing.fast so the next screen's
* content ignites ~160ms after the flood lands. */
const SETTLE = timing.fast;
/** Two frames for React to commit the swapped content under the circle
* before it starts fading, so the old screen never flashes through. */
const COMMIT_FRAMES_MS = 32;
/** Base diameter of the circle view; growth is scale = needed / BASE. */
const BASE = 64;
/** Rim width in points at any scale — a hairline of light, not a stroke. */
const RIM = 2;
/** Rim light — white over the fill reads brighter on every hue. */
const RIM_COLOR = "rgba(255,255,255,0.6)";
/** The flood ignites: a fast rise out of the touch that eases as it
* reaches the far corner. */
const EASE_OUT = Easing.bezier(...ease.out);
type Direction = "reveal" | "conceal";
function isEvent(from: CircleRevealFrom): from is GestureResponderEvent {
return typeof from === "object" && from !== null && "nativeEvent" in from;
}
export const CircleReveal = forwardRef<CircleRevealHandle, CircleRevealProps>(function CircleReveal(
{
active,
origin,
color,
concealColor,
duration = REVEAL_MS,
concealDuration = CONCEAL_MS,
onCovered,
onDone,
rim = true,
rimColor = RIM_COLOR,
children,
className,
onLayout,
...props
},
ref
) {
const { colors } = useTheme();
const haptic = useHaptic();
const reduce = useReducedMotion();
const revealColor = color ?? colors.background;
const backColor = concealColor ?? revealColor;
const viewRef = React.useRef<View>(null);
const size = React.useRef({ w: 0, h: 0 });
const offset = React.useRef({ x: 0, y: 0 });
// UI-thread state for the circle.
const ox = useSharedValue(0);
const oy = useSharedValue(0);
const target = useSharedValue(1);
const grow = useSharedValue(0);
const fill = useSharedValue(1);
const tint = useSharedValue(revealColor);
const revealed = useSharedValue(active ? 1 : 0);
const busy = React.useRef(false);
const latest = React.useRef({ onCovered, onDone, haptic });
latest.current = { onCovered, onDone, haptic };
const measure = React.useCallback(() => {
viewRef.current?.measureInWindow?.((x, y) => {
offset.current = { x, y };
});
}, []);
const handleLayout = (e: LayoutChangeEvent) => {
const { width, height } = e.nativeEvent.layout;
size.current = { w: width, h: height };
measure();
onLayout?.(e);
};
const toLocal = React.useCallback(
(pageX: number, pageY: number): CircleRevealOrigin => ({ x: pageX - offset.current.x, y: pageY - offset.current.y }),
[]
);
const finish = React.useCallback(
(dir: Direction) => {
busy.current = false;
grow.value = 0;
latest.current.onDone?.(dir === "reveal");
},
[grow]
);
const covered = React.useCallback(
(dir: Direction) => {
latest.current.haptic.selection();
latest.current.onCovered?.(dir === "reveal");
fill.value = withDelay(
COMMIT_FRAMES_MS,
withTiming(0, { ...SETTLE, easing: EASE_OUT }, (ok) => {
if (ok) runOnJS(finish)(dir);
})
);
},
[fill, finish]
);
const start = React.useCallback(
(dir: Direction, o: CircleRevealOrigin, override?: string) => {
const { w, h } = size.current;
// Radius to the farthest corner (+1pt so the anti-aliased edge clears it).
const r = Math.max(Math.hypot(o.x, o.y), Math.hypot(w - o.x, o.y), Math.hypot(o.x, h - o.y), Math.hypot(w - o.x, h - o.y)) + 1;
const config = { duration: dir === "reveal" ? duration : concealDuration, easing: EASE_OUT };
const to = dir === "reveal" ? 1 : 0;
cancelAnimation(grow);
cancelAnimation(fill);
ox.value = o.x;
oy.value = o.y;
target.value = (r * 2) / BASE;
tint.value = override ?? (dir === "reveal" ? revealColor : backColor);
latest.current.haptic.light();
if (reduce) {
// Colour crossfade only — a full-size layer fades in, no growth or travel.
grow.value = 1;
fill.value = 0;
fill.value = withTiming(1, timing.fast, (ok) => {
if (!ok) return;
revealed.value = to;
runOnJS(covered)(dir);
});
return;
}
revealed.value = withTiming(to, config);
fill.value = 1;
grow.value = 0;
grow.value = withTiming(1, config, (ok) => {
if (ok) runOnJS(covered)(dir);
});
},
[duration, concealDuration, grow, fill, ox, oy, target, tint, revealColor, backColor, revealed, reduce, covered]
);
const run = React.useCallback(
(dir: Direction, from?: CircleRevealFrom, override?: string) => {
const { w, h } = size.current;
if (busy.current || w === 0 || h === 0) return;
busy.current = true;
if (from != null && isEvent(from)) {
// Re-measure first so a scrolled page can't skew the origin.
const { pageX, pageY } = from.nativeEvent;
const node = viewRef.current;
if (node?.measureInWindow) {
node.measureInWindow((x, y) => {
offset.current = { x, y };
start(dir, toLocal(pageX, pageY), override);
});
} else {
start(dir, toLocal(pageX, pageY), override);
}
return;
}
start(dir, from ?? origin ?? { x: w / 2, y: h }, override);
},
[origin, start, toLocal]
);
React.useImperativeHandle(
ref,
() => ({
reveal: (from, c) => run("reveal", from, c),
conceal: (from, c) => run("conceal", from, c),
toLocal,
}),
[run, toLocal]
);
// Declarative trigger — kicks the side effect when `active` flips.
const prevActive = React.useRef(active);
React.useEffect(() => {
if (active === undefined || active === prevActive.current) return;
prevActive.current = active;
run(active ? "reveal" : "conceal");
}, [active, run]);
const circleStyle = useAnimatedStyle(() => ({
left: ox.value - BASE / 2,
top: oy.value - BASE / 2,
opacity: grow.value === 0 ? 0 : fill.value,
backgroundColor: tint.value,
transform: [{ scale: grow.value * target.value }],
}));
// The rim rides the same transform; its border is divided by the scale so
// it stays RIM points wide, and it dims as the flood covers.
const rimStyle = useAnimatedStyle(() => {
const s = Math.max(grow.value * target.value, 0.001);
return {
left: ox.value - BASE / 2,
top: oy.value - BASE / 2,
opacity: grow.value === 0 ? 0 : (1 - grow.value) * fill.value,
borderWidth: Math.min(RIM / s, BASE / 2),
transform: [{ scale: s }],
};
});
const content = typeof children === "function" ? children(revealed) : children;
return (
<View
ref={viewRef}
pointerEvents="box-none"
accessibilityRole="none"
onLayout={handleLayout}
className={cn("absolute inset-0 overflow-hidden", className)}
{...props}
>
<Animated.View
pointerEvents="none"
importantForAccessibility="no-hide-descendants"
accessibilityElementsHidden
style={[{ position: "absolute", width: BASE, height: BASE, borderRadius: BASE / 2 }, circleStyle]}
/>
{rim && !reduce ? (
<Animated.View
pointerEvents="none"
importantForAccessibility="no-hide-descendants"
accessibilityElementsHidden
style={[{ position: "absolute", width: BASE, height: BASE, borderRadius: BASE / 2, borderColor: rimColor }, rimStyle]}
/>
) : null}
{content}
</View>
);
});
CircleReveal.displayName = "CircleReveal"; import { CircleReveal } from "@/components/ui/circle-reveal/circle-reveal";
export function Example() {
return (
<CircleReveal />
);
} Installation
Install the dependencies
npx expo install react-native-reanimatedCopy the source from the Code tab into your project
components/ui/circle-reveal/circle-reveal.tsxcomponents/ui/circle-reveal/index.tsUpdate the import paths to match your project setup.
Usage
import { CircleReveal } from "@/components/ui/circle-reveal/circle-reveal"; <CircleReveal /> Examples
Food delivery checkout.
import * as React from "react";
import { View, type GestureResponderEvent, type LayoutChangeEvent } from "react-native";
import { Accent, LightFall, SwitchOn, rowDelay, useTheme } from "@lumioui/core";
import { CircleReveal, type CircleRevealHandle } from "../circle-reveal";
import { Button } from "../../button/button";
import { Icon, type IconName } from "../../icon/icon";
import { SuccessSeal } from "../../success-seal/success-seal";
import { Text } from "../../text/text";
const ITEMS = [
["2×", "Lemongrass chicken bánh mì", "$23.00"],
["1×", "Crispy tofu vermicelli bowl", "$14.50"],
["2×", "Iced condensed-milk coffee", "$11.00"],
] as const;
const TOTALS = [
["Subtotal", "$48.50"],
["Delivery", "$2.99"],
["Tip", "$6.00"],
] as const;
const TRACKING: [IconName, string, string][] = [
["clock", "Estimated arrival", "6:48 PM"],
["utensils", "Saigon Corner is cooking", "Now"],
["map-pin", "418 Valencia St, Apt 3", ""],
];
/** Card corner radius — the stamp's light stays inside it. */
const CARD_RADIUS = 16;
/** The order itself — the hero that stays lit above the flood. */
function OrderCard() {
return (
<View className="gap-4 bg-card p-4">
{ITEMS.map(([qty, name, price]) => (
<View key={name} className="flex-row items-center gap-3">
<Text className="w-7 text-[15px] font-semibold text-primary-text tabular-nums">{qty}</Text>
<Text className="flex-1 text-[15px]" numberOfLines={1}>
{name}
</Text>
<Text className="text-[15px] tabular-nums">{price}</Text>
</View>
))}
<View className="flex-row justify-between border-t border-border pt-3">
<Text className="text-lg font-semibold">Total</Text>
<Text className="text-lg font-semibold tabular-nums">$57.49</Text>
</View>
</View>
);
}
function Checkout() {
const { colors } = useTheme();
const reveal = React.useRef<CircleRevealHandle>(null);
/** The page under the flood has turned into the placed page. */
const [placed, setPlaced] = React.useState(false);
/** The flood has cleared — the stamp lands on the card. */
const [stamped, setStamped] = React.useState(false);
/** The stamp has held — tracking builds in below the card. */
const [tracking, setTracking] = React.useState(false);
/** The card's slot in the page (measured), so the hero can sit above the flood. */
const [slot, setSlot] = React.useState<{ y: number; h: number } | null>(null);
const [cardH, setCardH] = React.useState(0);
const place = (e: GestureResponderEvent) => reveal.current?.reveal(e, colors.primary);
const back = (e: GestureResponderEvent) => reveal.current?.conceal(e, colors.background);
return (
<View className="min-h-[700px] w-full flex-1 overflow-hidden bg-background">
{placed ? <LightFall reach={0.55} /> : null}
<View className="flex-1 px-5 pb-8 pt-14">
<View className="gap-1 pb-6">
<Text className="text-3xl font-bold tracking-tight">{placed ? "Order placed" : "Your order"}</Text>
<Text className="text-sm text-muted-foreground">
{placed ? "Arriving 6:40–6:55 PM" : "Saigon Corner · 1.2 mi away"}
</Text>
</View>
{/* The card's slot — the card itself renders above the flood. */}
<View
style={{ height: cardH }}
onLayout={(e: LayoutChangeEvent) => setSlot({ y: e.nativeEvent.layout.y, h: e.nativeEvent.layout.height })}
/>
{placed ? (
<View className="flex-1 justify-between pt-6">
{tracking ? (
<View className="overflow-hidden rounded-2xl bg-card">
{TRACKING.map(([icon, label, value], i) => (
<SwitchOn
key={label}
delay={rowDelay(i)}
className={`min-h-[52px] flex-row items-center gap-3 px-4 ${i < TRACKING.length - 1 ? "border-b border-border" : ""}`}
>
<Icon name={icon} size="sm" color="mutedForeground" />
<Text className="flex-1 text-[15px]" numberOfLines={1}>
{label}
</Text>
{value ? <Text className="text-[15px] font-semibold tabular-nums">{value}</Text> : null}
</SwitchOn>
))}
</View>
) : (
<View />
)}
{tracking ? (
<SwitchOn delay={rowDelay(TRACKING.length)}>
<Button size="lg" variant="secondary" onPress={back}>
Back to menu
</Button>
</SwitchOn>
) : null}
</View>
) : (
<View className="flex-1 justify-between pt-6">
<View className="gap-2 px-1">
{TOTALS.map(([label, value]) => (
<View key={label} className="flex-row justify-between">
<Text className="text-[15px] text-muted-foreground">{label}</Text>
<Text className="text-[15px] text-muted-foreground tabular-nums">{value}</Text>
</View>
))}
</View>
<View className="gap-3">
<View className="h-11 flex-row items-center gap-3 px-1">
<Icon name="credit-card" size="sm" color="foreground" />
<Text className="flex-1 text-[15px] font-medium">Visa •••• 4417</Text>
<Text className="text-sm text-muted-foreground">Change</Text>
</View>
<Button size="lg" onPress={place}>
Place order · $57.49
</Button>
</View>
</View>
)}
</View>
<CircleReveal
ref={reveal}
onCovered={(revealed) => {
setPlaced(revealed);
if (!revealed) {
setStamped(false);
setTracking(false);
}
}}
onDone={(revealed) => setStamped(revealed)}
>
{/* The hero rides above the flood: it is the thing that was placed. */}
<View
pointerEvents="box-none"
style={{ position: "absolute", left: 20, right: 20, top: slot?.y ?? 0, opacity: slot ? 1 : 0 }}
onLayout={(e: LayoutChangeEvent) => setCardH(e.nativeEvent.layout.height)}
>
<SuccessSeal tone="primary" size="md" on={stamped} radius={CARD_RADIUS} onSettled={() => setTracking(true)}>
<OrderCard />
</SuccessSeal>
</View>
</CircleReveal>
</View>
);
}
/** CircleRevealCheckout — food delivery checkout. Place order: an orange
* flood with a lit rim pours out of the button while the order card stays
* above it. The flood clears onto a page lit from above, the card is
* stamped and catches one sheen, holds, and tracking switches on below it.
* Back to menu wipes the canvas back over from where you tapped. Orange,
* for food. */
export function CircleRevealCheckout() {
return (
<Accent color="orange" className="w-full flex-1">
<Checkout />
</Accent>
);
} A dark product hero for a running drop.
Pro source · 179 lines
Part of LumioUI Pro. With Pro, the full file shows here and npx @lumioui/cli add pro/circle-reveal-shop writes it into your repo. Unlocking your Pro source… Couldn't load the source. Refresh to try again.
Display settings in a reading app.
import * as React from "react";
import { Pressable, View, type GestureResponderEvent } from "react-native";
import { Accent, darkColors, lightColors, useTheme } from "@lumioui/core";
import { CircleReveal, type CircleRevealHandle } from "../circle-reveal";
import { Icon, type IconName } from "../../icon/icon";
import { Switch } from "../../switch/switch";
import { Text } from "../../text/text";
type Scheme = "light" | "dark";
const PALETTE = { light: lightColors, dark: darkColors } as const;
interface RowProps {
icon: IconName;
tint: string;
title: string;
detail?: string;
last?: boolean;
children?: React.ReactNode;
}
/** Settings row — per-item colour disc, inset hairline. */
function Row({ icon, tint, title, detail, last, children }: RowProps) {
return (
<View className="min-h-[52px] flex-row items-center gap-3 pl-4">
<View style={{ backgroundColor: tint }} className="h-8 w-8 items-center justify-center rounded-lg">
<Icon name={icon} size="sm" color="#FFFFFF" strokeWidth={2.2} />
</View>
<View className={`min-h-[52px] flex-1 flex-row items-center gap-2 pr-4 ${last ? "" : "border-b border-border"}`}>
<Text className="flex-1 text-base">{title}</Text>
{detail ? <Text className="text-[15px] text-muted-foreground">{detail}</Text> : null}
{children ?? <Icon name="chevron-right" size="sm" color="mutedForeground" />}
</View>
</View>
);
}
/** CircleRevealTheme — Display settings in a reading app. Tap the sun/moon:
* the other scheme's canvas floods out of the button, the whole screen
* re-themes under the cover, and the circle melts away. Ink, because
* settings are chrome. */
export function CircleRevealTheme() {
const reveal = React.useRef<CircleRevealHandle>(null);
// Opens in the app's scheme; a tap pins the other one (resolved in
// render, so a site-theme change before any tap is followed too).
const { scheme: inherited } = useTheme();
const [picked, setPicked] = React.useState<Scheme | null>(null);
const scheme: Scheme = picked ?? inherited;
const [warmTint, setWarmTint] = React.useState(true);
const [dimImages, setDimImages] = React.useState(false);
const next: Scheme = scheme === "light" ? "dark" : "light";
const toggle = (e: GestureResponderEvent) => reveal.current?.reveal(e, PALETTE[next].background);
return (
<View className="min-h-[700px] w-full flex-1 overflow-hidden">
<Accent color={PALETTE[scheme].primary} scheme={scheme} className="flex-1 bg-background">
<View className="flex-1 gap-6 px-4 pb-8 pt-6">
<View className="flex-row items-center justify-between pl-1">
<Text className="text-3xl font-bold tracking-tight">Display</Text>
<Pressable
onPress={toggle}
accessibilityRole="button"
accessibilityLabel={scheme === "light" ? "Switch to dark mode" : "Switch to light mode"}
className="h-11 w-11 items-center justify-center rounded-full bg-card"
>
<Icon name={scheme === "light" ? "moon" : "sun"} size="md" color="foreground" strokeWidth={2.2} />
</Pressable>
</View>
<View className="gap-3 rounded-2xl bg-card p-5">
<Text className="text-sm text-muted-foreground">Preview · Chapter 4</Text>
<Text className="text-[17px] leading-6">
The ferry left at dusk, and by the time the harbour lights had thinned to a single line, Mara had read the letter three
times.
</Text>
</View>
<View className="gap-2">
<Text className="pl-4 text-sm text-muted-foreground">Appearance</Text>
<View className="overflow-hidden rounded-2xl bg-card">
<Row icon={scheme === "light" ? "sun" : "moon"} tint="#3F3F46" title="Theme" detail={scheme === "light" ? "Light" : "Dark"} />
<Row icon="type" tint="#0F766E" title="Text size" detail="17 pt" />
<Row icon="eye" tint="#C2410C" title="Warm tint">
<Switch checked={warmTint} onCheckedChange={setWarmTint} accessibilityLabel="Warm tint" />
</Row>
<Row icon="image" tint="#DB2777" title="Dim images in dark" last>
<Switch checked={dimImages} onCheckedChange={setDimImages} accessibilityLabel="Dim images in dark" />
</Row>
</View>
</View>
</View>
</Accent>
<CircleReveal ref={reveal} onCovered={() => setPicked(next)} />
</View>
);
} API reference
active boolean Declarative trigger: false → true reveals, true → false conceals. Optional — the imperative ref handle works without it.
—origin CircleRevealOrigin Origin in the overlay's coordinates. Default bottom-centre.
—color string Reveal fill — the NEXT screen's background. Default theme background.
—concealColor string Conceal fill — the PREVIOUS screen's background. Default color.
duration number Reveal flood in ms. Default 315 (tempo.settle).
REVEAL_MS concealDuration number Conceal flood in ms. Default 250 — going back runs quicker than the commit.
CONCEAL_MS onCovered (revealed: boolean) => void Circle fully covers the surface — swap content now. revealed is true after a reveal, false after a conceal.
onDone (revealed: boolean) => void The circle has faded away and the transition is complete.
—rim boolean Lit leading rim on the flood's edge. Default true.
true rimColor string Rim light colour — brighter than the fill. Default soft white.
RIM_COLOR children React.ReactNode | ((revealed: SharedValu …
React.ReactNode | ((revealed: SharedValue<number>) => React.ReactNode) Rendered above the circle (shared elements). A function receives the revealed shared value, 0 → 1 on reveal and 1 → 0 on conceal.
className string —