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.
Progress
Progress bar that glides smoothly to each new value and gently pulses while the amount is unknown. On reaching 100% it can fold into a done line with a check and a soft pool of light.
Preview
import * as React from "react";
import { forwardRef } from "react";
import { Text, View, type LayoutChangeEvent, type ViewProps } from "react-native";
import Animated, {
cancelAnimation,
useAnimatedProps,
useSharedValue,
useAnimatedStyle,
withDelay,
withSpring,
withTiming,
withRepeat,
Easing,
} from "react-native-reanimated";
import Svg from "react-native-svg";
import {
AnimatedPath,
LightPool,
cn,
ease,
spring,
tempo,
timing,
useHaptic,
useReducedMotion,
useTheme,
} from "@lumioui/core";
import { Glass } from "../glass";
export interface ProgressProps extends ViewProps {
/** 0–100 */
value: number;
className?: string;
/** Fill bar classes. */
indicatorClassName?: string;
/** Unknown progress — the whole track breathes in place, slowly; nothing travels. */
indeterminate?: boolean;
/** Glass lane — a taller frosted pill instead of the hairline. */
glass?: boolean;
/** Reaching 100 becomes a moment: a light pool blooms under the bar, it
* holds, then the bar folds into this line with a drawn check. */
completeLabel?: string;
/** Fires when the bar reaches 100 and its moment has held. */
onComplete?: () => void;
}
/** Determinate fill — timing.normal on ease.out: one glide to the new value. */
const FILL_TIMING = { duration: timing.normal.duration, easing: Easing.bezier(...ease.out) };
/** The fill rests just under full; completion brightens it to full accent. */
const FILL_REST = 0.9;
/** Indeterminate breath — one half (dim → bright) over two roll beats, in
* place. Opacity only, so reduced motion keeps it. */
const BREATH = { duration: tempo.roll * 2, easing: Easing.bezier(...ease.inOut) };
/** The breathing fill's low and high brightness. */
const BREATH_LOW = 0.25;
const BREATH_HIGH = 0.7;
/** Completion holds this long before folding (act → hold → resolve). */
const COMPLETE_HOLD = 700;
const CHECK_PATH = "M5 12.5l4.5 4.5L19 7.5";
const CHECK_LEN = 22;
const CHECK_DRAW = { duration: 240, easing: Easing.bezier(...ease.out) };
const IGNITE = { duration: timing.fast.duration, easing: Easing.bezier(...ease.out) };
const DIM = { duration: timing.recede.duration, easing: Easing.bezier(...ease.in) };
/** Progress — a bar where light is the material. The fill glides on the UI
* thread (translated, never resized). Indeterminate is the whole track
* breathing in place — nothing sweeps across it. Reaching 100 brightens the
* fill in place; with `completeLabel` a light pool blooms under the bar, it
* holds 700ms, and the bar folds into a "done" line with a drawn check that
* stays. */
export const Progress = forwardRef<React.ElementRef<typeof View>, ProgressProps>(
function Progress(
{
value,
className,
indicatorClassName,
indeterminate,
glass = false,
completeLabel,
onComplete,
onLayout,
...props
},
ref
) {
const clamped = Math.max(0, Math.min(100, value));
const reduceMotion = useReducedMotion();
const haptic = useHaptic();
const { colors } = useTheme();
// 0..1 fill fraction. The fill is a full-width bar slid in from the
// left by transform, never an animated width (which relayouts per frame).
const fill = useSharedValue(clamped / 100);
const bright = useSharedValue(clamped >= 100 ? 1 : 0);
const trackWidth = useSharedValue(0);
const breath = useSharedValue(BREATH_LOW);
const first = React.useRef(true);
React.useEffect(() => {
if (first.current) {
first.current = false;
return;
}
// Reduced motion: jump straight to the value — the light stays.
fill.value = reduceMotion ? clamped / 100 : withTiming(clamped / 100, FILL_TIMING);
}, [clamped, fill, reduceMotion]);
// Completion — brighten in place, (pool, hold, fold).
const [pooled, setPooled] = React.useState(false);
const [folded, setFolded] = React.useState(false);
const done = clamped >= 100;
const wasDone = React.useRef(done);
const completeRef = React.useRef(onComplete);
completeRef.current = onComplete;
React.useEffect(() => {
if (done === wasDone.current) return;
wasDone.current = done;
if (!done || indeterminate) {
bright.value = withTiming(0, DIM);
setPooled(false);
setFolded(false);
return;
}
const lead = timing.normal.duration;
bright.value = withDelay(lead, withTiming(1, IGNITE));
const timers = [
setTimeout(() => {
if (completeLabel) {
setPooled(true);
haptic.success();
}
}, lead),
setTimeout(() => {
if (completeLabel) setFolded(true);
completeRef.current?.();
}, lead + COMPLETE_HOLD),
];
return () => timers.forEach(clearTimeout);
// Edge-triggered on reaching / leaving 100.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [done]);
// Indeterminate — the whole track breathes, in place.
React.useEffect(() => {
if (!indeterminate) {
cancelAnimation(breath);
return;
}
breath.value = BREATH_LOW;
breath.value = withRepeat(withTiming(BREATH_HIGH, BREATH), -1, true);
return () => cancelAnimation(breath);
}, [indeterminate, breath]);
const fillStyle = useAnimatedStyle(() => {
const w = trackWidth.value;
// Hidden only until the first layout pass measures the track.
return {
opacity: w > 0 ? FILL_REST + (1 - FILL_REST) * bright.value : 0,
transform: [{ translateX: (fill.value - 1) * w }],
};
});
const breathStyle = useAnimatedStyle(() => ({ opacity: breath.value }));
// Fold — the bar's height gives way to the done line.
const [barH, setBarH] = React.useState(0);
const [lineH, setLineH] = React.useState(0);
const fold = useSharedValue(0);
const draw = useSharedValue(0);
React.useEffect(() => {
if (!completeLabel) return;
if (folded) {
fold.value = reduceMotion ? withTiming(1, timing.normal) : withSpring(1, spring.surface);
draw.value = 0;
draw.value = reduceMotion ? 1 : withDelay(timing.fast.duration, withTiming(1, CHECK_DRAW));
} else {
fold.value = withTiming(0, timing.fast);
}
}, [folded, completeLabel, fold, draw, reduceMotion]);
const foldStyle = useAnimatedStyle(
() => (barH > 0 && lineH > 0 ? { height: barH + (lineH - barH) * fold.value } : {}),
[barH, lineH]
);
const barStyle = useAnimatedStyle(() => ({
opacity: 1 - Math.min(1, fold.value * 1.6),
transform: [{ scaleY: reduceMotion ? 1 : 1 - fold.value * 0.6 }],
}));
const lineStyle = useAnimatedStyle(() => ({
opacity: Math.max(0, fold.value * 1.4 - 0.4),
}));
const checkProps = useAnimatedProps(() => ({ strokeDashoffset: CHECK_LEN * (1 - draw.value) }));
const track = (
<View
ref={ref}
className={cn(
glass
? "w-full overflow-hidden rounded-full"
: cn("h-2 w-full overflow-hidden rounded-full bg-secondary", indeterminate && "bg-primary/15"),
className
)}
style={glass ? { height: 14 } : undefined}
onLayout={(e) => {
trackWidth.value = e.nativeEvent.layout.width;
setBarH(e.nativeEvent.layout.height);
onLayout?.(e);
}}
accessibilityRole="progressbar"
accessibilityLabel={folded && completeLabel ? completeLabel : undefined}
accessibilityValue={indeterminate ? undefined : { min: 0, max: 100, now: clamped }}
accessibilityState={indeterminate ? { busy: true } : undefined}
// RNW drops the accessibilityValue/accessibilityState objects —
// direct aria-* props keep web screen readers informed (switch pattern).
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={indeterminate ? undefined : clamped}
aria-busy={indeterminate ? true : undefined}
{...props}
>
{glass ? <Glass effect="clear" className="absolute inset-0 rounded-full" pointerEvents="none" /> : null}
{indeterminate ? (
// The whole lane, lit in the accent, breathing in place.
<Animated.View
pointerEvents="none"
style={breathStyle}
className={cn("h-full w-full rounded-full bg-primary", indicatorClassName)}
/>
) : (
<Animated.View
style={fillStyle}
className={cn("h-full w-full overflow-hidden rounded-full bg-primary", indicatorClassName)}
/>
)}
</View>
);
if (!completeLabel) return track;
return (
<Animated.View style={foldStyle} className="w-full justify-center">
<LightPool on={pooled} size={220} strength={0.3} className="absolute self-center" />
<Animated.View style={barStyle}>{track}</Animated.View>
{/* The done line — measured once, then shown in place of the bar. */}
<Animated.View
pointerEvents="none"
style={[{ position: "absolute", top: 0, left: 0, right: 0 }, lineStyle]}
className="flex-row items-center gap-2"
onLayout={(e: LayoutChangeEvent) => setLineH(e.nativeEvent.layout.height)}
accessibilityElementsHidden={!folded}
>
<View className="h-6 w-6 items-center justify-center rounded-full bg-primary">
<Svg width={16} height={16} viewBox="0 0 24 24">
<AnimatedPath
d={CHECK_PATH}
stroke={colors.primaryForeground}
strokeWidth={3}
strokeLinecap="round"
strokeLinejoin="round"
fill="none"
strokeDasharray={CHECK_LEN}
animatedProps={checkProps}
/>
</Svg>
</View>
<Text className="text-[15px] font-semibold text-foreground">{completeLabel}</Text>
</Animated.View>
</Animated.View>
);
}
);
Progress.displayName = "Progress"; import { Progress } from "@/components/ui/progress/progress";
export function Example() {
return (
<Progress />
);
} Installation
Install the dependencies
npx expo install react-native-reanimated react-native-svgAdd the components it builds on
Copy the source from the Code tab into your project
components/ui/progress/progress.tsxcomponents/ui/progress/index.tsUpdate the import paths to match your project setup.
Usage
import { Progress } from "@/components/ui/progress/progress"; <Progress /> Examples
A savings pot in a banking app.
import * as React from "react";
import { View } from "react-native";
import { Accent } from "@lumioui/core";
import { Progress } from "../progress";
import { Button } from "../../button/button";
import { Text } from "../../text/text";
const GOAL = 2400;
/** ProgressAnimated — a savings pot in a banking app. The bar is the goal;
* each deposit glides the fill forward.
* The deposit that reaches the goal brightens the bar in place and blooms
* light under it; it holds, then folds into a
* "Goal reached" line that stays. */
export function ProgressAnimated() {
const [saved, setSaved] = React.useState(1480);
const pct = Math.min(100, (saved / GOAL) * 100);
const reached = saved >= GOAL;
return (
<Accent color="green" className="w-full">
<View className="w-full gap-5 rounded-3xl bg-card p-5">
<View className="gap-1">
<Text variant="muted">Road bike fund</Text>
<Text className="text-5xl font-semibold tracking-tight tabular-nums">
${saved.toLocaleString("en-US")}
</Text>
<Text variant="muted">
{reached ? "Goal reached. Time to ride." : `$${(GOAL - saved).toLocaleString("en-US")} to go · by 14 March`}
</Text>
</View>
<View className="gap-2">
<Progress value={pct} className="h-3" completeLabel="Goal reached · ready to ride" />
<View className="flex-row justify-between">
<Text className="text-xs text-muted-foreground tabular-nums">{Math.round(pct)}%</Text>
<Text className="text-xs text-muted-foreground tabular-nums">${GOAL.toLocaleString("en-US")}</Text>
</View>
</View>
<View className="flex-row gap-2">
<Button
size="lg"
className="flex-1"
disabled={reached}
onPress={() => setSaved((s) => Math.min(GOAL, s + 200))}
>
Add $200
</Button>
<Button size="lg" variant="secondary" className="flex-1" onPress={() => setSaved(1480)}>
Reset
</Button>
</View>
</View>
</Accent>
);
} A frosted lane over the photo being posted, the way a social app shows an upload riding over the media itself.
import * as React from "react";
import { Image, StyleSheet, View, Text } from "react-native";
import { Progress } from "../progress";
const PHOTO =
"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&h=1000&fit=crop&q=70&auto=format";
/** ProgressGlass — a frosted lane over the photo being posted, the way a
* social app shows an upload riding over the media itself. */
export function ProgressGlass() {
const [v, setV] = React.useState(12);
React.useEffect(() => {
const t = setInterval(() => setV((x) => (x >= 96 ? 12 : x + 7)), 900);
return () => clearInterval(t);
}, []);
const sent = Math.max(1, Math.round((v / 100) * 18));
return (
<View className="relative h-[440px] w-full overflow-hidden rounded-2xl bg-muted">
<Image source={{ uri: PHOTO }} style={StyleSheet.absoluteFill} resizeMode="cover" accessibilityIgnoresInvertColors />
<View className="absolute inset-x-0 bottom-0 gap-3 bg-black/40 px-5 pb-6 pt-5">
<View className="flex-row items-baseline justify-between">
<View>
<Text className="text-[17px] font-semibold text-white">Posting to Ridge Weekend</Text>
<Text className="text-sm text-white/80 tabular-nums">{sent} of 18 photos</Text>
</View>
<Text className="text-[17px] font-semibold tabular-nums text-white">{v}%</Text>
</View>
{/* Fill pinned white: it rides a dark scrim over the photo in both
app schemes, where ink primary turns into a near-black bar. */}
<Progress glass value={v} indicatorClassName="bg-white" />
</View>
</View>
);
} A system software update.
import * as React from "react";
import { View } from "react-native";
import { Progress } from "../progress";
import { Button } from "../../button/button";
import { Text } from "../../text/text";
type Phase = "idle" | "preparing" | "downloading" | "ready";
/** ProgressIndeterminate — a system software update. While the size is
* unknown the bar breathes in place; once the download starts it hands over to a real
* fill. Tap "Download and install" to run it. */
export function ProgressIndeterminate() {
const [phase, setPhase] = React.useState<Phase>("idle");
const [pct, setPct] = React.useState(0);
React.useEffect(() => {
if (phase === "preparing") {
const t = setTimeout(() => setPhase("downloading"), 2200);
return () => clearTimeout(t);
}
if (phase === "downloading") {
if (pct >= 100) {
const t = setTimeout(() => setPhase("ready"), 400);
return () => clearTimeout(t);
}
const t = setTimeout(() => setPct((p) => Math.min(100, p + 9)), 500);
return () => clearTimeout(t);
}
}, [phase, pct]);
const status =
phase === "preparing"
? "Preparing update…"
: phase === "downloading"
? `${((Math.min(pct, 100) / 100) * 3.1).toFixed(1)} GB of 3.1 GB · about ${Math.max(1, Math.round((100 - pct) / 12))} min left`
: phase === "ready"
? "Ready to install tonight at 2:00 AM"
: "3.1 GB · released 2 days ago";
return (
<View className="w-full gap-6">
<Text className="px-1 text-2xl font-bold tracking-tight">Software Update</Text>
<View className="w-full gap-4 rounded-2xl bg-card p-4">
<View className="flex-row items-center gap-3">
<View className="h-12 w-12 items-center justify-center rounded-xl bg-foreground">
<Text className="text-lg font-bold text-background">26</Text>
</View>
<View className="flex-1">
<Text className="text-[17px] font-semibold">System 26.1</Text>
<Text variant="muted">Security fixes and battery improvements</Text>
</View>
</View>
{phase === "preparing" || phase === "downloading" ? (
<Progress value={pct} indeterminate={phase === "preparing"} />
) : null}
<Text variant="muted">{status}</Text>
{phase === "idle" ? (
<Button size="lg" className="w-full" onPress={() => setPhase("preparing")}>
Download and install
</Button>
) : phase === "ready" ? (
<Button size="lg" variant="secondary" className="w-full" onPress={() => { setPct(0); setPhase("idle"); }}>
Install now
</Button>
) : null}
</View>
</View>
);
} API reference
value* number 0–100
—className string — indicatorClassName string Fill bar classes.
—indeterminate boolean Unknown progress — the whole track breathes in place, slowly; nothing travels.
—glass boolean Glass lane — a taller frosted pill instead of the hairline.
false completeLabel string Reaching 100 becomes a moment: a light pool blooms under the bar, it holds, then the bar folds into this line with a drawn check.
—onComplete () => void Fires when the bar reaches 100 and its moment has held.
—