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.
Radio Group
Radio options for picking one choice from a list, as simple rows or cards. The chosen dot lights up with a soft glow while the previous choice fades.
Preview
import * as React from "react";
import { createContext, forwardRef, useContext } from "react";
import { View, Pressable, Text, type ViewProps, type PressableProps, type GestureResponderEvent } from "react-native";
import Animated, {
Easing,
useSharedValue,
useAnimatedStyle,
withSequence,
withSpring,
withTiming,
interpolateColor,
} from "react-native-reanimated";
import Svg, { Defs, RadialGradient, Rect, Stop } from "react-native-svg";
import { cn, ease, useHaptic, useReducedMotion, usePressAnimation, useTheme, spring, timing, AnimatedPressable } from "@lumioui/core";
import { Icon, type IconName } from "../icon";
interface RadioGroupCtx {
value: string;
onValueChange: (v: string) => void;
disabled?: boolean;
}
const Ctx = createContext<RadioGroupCtx | null>(null);
export interface RadioGroupProps extends ViewProps {
/** Controlled value. Omit with defaultValue for uncontrolled use. */
value?: string;
/** Uncontrolled initial value. */
defaultValue?: string;
onValueChange?: (value: string) => void;
disabled?: boolean;
className?: string;
}
// Radio switch-on: each ring owns its dot. Picking an option ignites its dot
// (opacity on timing.fast, scale 0.4 → 1 on spring.pop — the pick landing is
// a spark) while the previous dot dims in place. Light doesn't travel
// between rings. Ring colour shifts on timing.fast alongside.
const RING = 24;
const DOT = 12;
/** The dot sparks up from a small core of light. */
const DOT_FROM = 0.4;
/** The ring dips like a checkbox while pressed — a small control needs depth. */
const RING_PRESSED = 0.94;
const IGNITE = { duration: timing.fast.duration, easing: Easing.bezier(...ease.out) };
const DIM = { duration: timing.recede.duration, easing: Easing.bezier(...ease.in) };
// The dot is a light source that lights its row: on pick a pool of accent
// light brightens behind the ring over timing.fast, then settles over
// timing.slow. A card row keeps it faintly lit (the evidence of the pick);
// a plain row lets it go out so a bare list rests exactly as before.
/** Pool diameter — a card row's ring lights most of its own row. */
const POOL = 120;
/** Plain rows have no surface to hold the light, so the pool stays small. */
const POOL_PLAIN = 88;
/** Peak alpha at the pool's centre. */
const POOL_PEAK = 0.18;
/** Resting share of the peak on a picked card row (0.08 of 0.18). */
const POOL_REST = 0.44;
const SETTLE = { duration: timing.slow.duration, easing: Easing.bezier(...ease.inOut) };
/** The picked card takes a faint accent wash — selected reads as lit. */
const CARD_WASH = 0.06;
const SHIFT = { duration: timing.normal.duration, easing: Easing.bezier(...ease.inOut) };
/** RadioGroup — controlled or uncontrolled group; the picked ring's dot ignites, with a selection haptic. */
export const RadioGroup = forwardRef<React.ElementRef<typeof View>, RadioGroupProps>(
function RadioGroup({ value, defaultValue, onValueChange, disabled, className, children, accessibilityLabel, ...props }, ref) {
const [internal, setInternal] = React.useState(defaultValue ?? value ?? "");
// Active value resolves during render — never in a passive effect.
const active = value ?? internal;
const handleChange = React.useCallback(
(v: string) => {
if (value === undefined) setInternal(v);
onValueChange?.(v);
},
[value, onValueChange]
);
return (
<Ctx.Provider value={{ value: active, onValueChange: handleChange, disabled }}>
<View
ref={ref}
className={cn("w-full gap-3", className)}
accessibilityRole="radiogroup"
accessibilityLabel={accessibilityLabel ?? "Radio group"}
{...props}
>
{children}
</View>
</Ctx.Provider>
);
}
);
export interface RadioGroupItemProps extends Omit<PressableProps, "children"> {
value: string;
label?: string;
/** Leading icon in the option row. */
icon?: IconName;
/** Secondary text under the label. */
subtitle?: string;
/** Custom leading node (brand mark, colour tile, artwork). Wins over `icon`. */
leading?: React.ReactNode;
/** Trailing node on the row's right edge (price, badge). */
trailing?: React.ReactNode;
/** Put the ring on the trailing edge instead of the leading one — a
* settings-list layout where the row content leads and the control follows. */
indicatorPosition?: "leading" | "trailing";
disabled?: boolean;
className?: string;
/** Custom content rendered next to the ring when `label` is absent. */
children?: React.ReactNode;
/** "card" draws the option as a bordered row whose border and accent wash
* crossfade on pick and whose ring keeps a faint light. Default "plain". */
surface?: "plain" | "card";
}
/** The ring's light — a soft accent radial behind the dot. Decoration only. */
function RingLight({ size, opacityStyle, color, id }: { size: number; opacityStyle: object; color: string; id: string }) {
return (
<Animated.View
pointerEvents="none"
accessibilityElementsHidden
importantForAccessibility="no-hide-descendants"
style={[{ position: "absolute", width: size, height: size, left: (RING - size) / 2, top: (RING - size) / 2 }, opacityStyle]}
>
<Svg width={size} height={size}>
<Defs>
<RadialGradient id={id} cx="50%" cy="50%" r="50%">
<Stop offset={0} stopColor={color} stopOpacity={POOL_PEAK} />
<Stop offset={0.5} stopColor={color} stopOpacity={POOL_PEAK * 0.35} />
<Stop offset={1} stopColor={color} stopOpacity={0} />
</RadialGradient>
</Defs>
<Rect x="0" y="0" width={size} height={size} fill={`url(#${id})`} />
</Svg>
</Animated.View>
);
}
export const RadioGroupItem = forwardRef<React.ElementRef<typeof Pressable>, RadioGroupItemProps>(
function RadioGroupItem({ value, label, icon, subtitle, leading, trailing, indicatorPosition = "leading", surface = "plain", disabled, className, children, onPress, onPressIn, onPressOut, ...props }, ref) {
const ctx = useContext(Ctx);
if (!ctx) throw new Error("RadioGroupItem must be inside RadioGroup");
const { colors } = useTheme();
const haptics = useHaptic();
const selected = ctx.value === value;
const isDisabled = disabled || ctx.disabled;
const reducedMotion = useReducedMotion();
const ring = useSharedValue(selected ? 1 : 0);
const dotLight = useSharedValue(selected ? 1 : 0);
const dotScale = useSharedValue(1);
const card = surface === "card";
// Pool light (0–1 of the peak). A picked card mounts already lit at rest.
const pool = useSharedValue(selected && card ? POOL_REST : 0);
// Card border + wash crossfade, 0 → 1 as the row is picked.
const lit = useSharedValue(selected ? 1 : 0);
const gradientId = React.useId().replace(/[^a-zA-Z0-9]/g, "");
// Row press feedback — opacity dip only (scale 1 keeps the row stable).
const press = usePressAnimation({ pressedScale: 1, pressedOpacity: 0.6 });
// Ring press — the control itself dips while the row stays put, so the
// press reads on the thing being toggled.
const ringPress = useSharedValue(1);
// Only real changes animate — mount shows the resting state.
const shown = React.useRef(selected);
React.useEffect(() => {
if (shown.current === selected) return;
shown.current = selected;
ring.value = withTiming(selected ? 1 : 0, timing.fast);
lit.value = withTiming(selected ? 1 : 0, SHIFT);
if (selected) {
dotLight.value = withTiming(1, IGNITE);
// Light before the dot lands: the pool brightens, then settles.
pool.value = withSequence(withTiming(1, IGNITE), withTiming(card ? POOL_REST : 0, SETTLE));
if (reducedMotion) {
dotScale.value = 1;
} else {
dotScale.value = DOT_FROM;
dotScale.value = withSpring(1, spring.pop);
}
} else {
// Dims where it sits — no shrink, no travel.
dotLight.value = withTiming(0, DIM);
pool.value = withTiming(0, DIM);
}
}, [selected, ring, dotLight, dotScale, pool, lit, card, reducedMotion]);
// Unselected ring takes mutedForeground — `input` is a hairline tone that
// falls under 3:1 against cards.
const ringStyle = useAnimatedStyle(() => ({
borderColor: interpolateColor(ring.value, [0, 1], [colors.mutedForeground, colors.primary]),
transform: [{ scale: ringPress.value }],
}));
const dotStyle = useAnimatedStyle(() => ({
opacity: dotLight.value,
transform: [{ scale: dotScale.value }],
}));
const poolStyle = useAnimatedStyle(() => ({ opacity: pool.value }));
const cardStyle = useAnimatedStyle(() => ({
borderColor: interpolateColor(lit.value, [0, 1], [colors.border, colors.primary]),
}));
const washStyle = useAnimatedStyle(() => ({ opacity: lit.value * CARD_WASH }));
const ringNode = (
<View style={{ width: RING, height: RING }}>
<RingLight size={card ? POOL : POOL_PLAIN} opacityStyle={poolStyle} color={colors.primary} id={gradientId} />
<Animated.View
style={[
{
width: RING,
height: RING,
borderRadius: RING / 2,
borderWidth: 2,
alignItems: "center",
justifyContent: "center",
},
ringStyle,
]}
>
<Animated.View
pointerEvents="none"
style={[{ width: DOT, height: DOT, borderRadius: DOT / 2, backgroundColor: colors.primary }, dotStyle]}
/>
</Animated.View>
</View>
);
return (
<AnimatedPressable
ref={ref}
// The press style owns `opacity`, so a className opacity-50 would be
// overridden — disabled rows take a static dim instead.
style={[isDisabled ? { opacity: 0.5 } : press.animatedStyle, card ? { borderWidth: 2 } : null, card ? cardStyle : null]}
className={cn(
"min-h-11 w-full flex-row items-center gap-3",
card && "overflow-hidden rounded-2xl px-4 py-3",
className
)}
disabled={isDisabled}
onPressIn={(e) => {
press.onPressIn();
if (!reducedMotion) ringPress.value = withSpring(RING_PRESSED, spring.press);
onPressIn?.(e);
}}
onPressOut={(e) => {
press.onPressOut();
if (!reducedMotion) ringPress.value = withSpring(1, spring.press);
onPressOut?.(e);
}}
onPress={(e: GestureResponderEvent) => {
haptics.selection();
ctx.onValueChange(value);
onPress?.(e);
}}
accessibilityRole="radio"
accessibilityState={{ checked: selected, disabled: isDisabled }}
// accessibilityState isn't forwarded to the DOM on web — mirror it.
aria-checked={selected}
aria-disabled={isDisabled ?? false}
accessibilityLabel={label ?? value}
hitSlop={10}
{...props}
>
{card ? (
<Animated.View
pointerEvents="none"
style={[{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0, backgroundColor: colors.primary }, washStyle]}
/>
) : null}
{indicatorPosition === "leading" ? ringNode : null}
{leading ?? (icon ? (
<View className="h-8 w-8 items-center justify-center rounded-lg bg-muted">
<Icon name={icon} size="sm" color="foreground" />
</View>
) : null)}
{label ? (
<View className="min-w-0 flex-1 gap-0.5">
<Text className="text-base text-foreground" numberOfLines={1}>{label}</Text>
{subtitle ? (
<Text className="text-sm text-muted-foreground" numberOfLines={1}>{subtitle}</Text>
) : null}
</View>
) : children}
{trailing}
{indicatorPosition === "trailing" ? ringNode : null}
</AnimatedPressable>
);
}
);
RadioGroup.displayName = "RadioGroup";
RadioGroupItem.displayName = "RadioGroupItem"; import { RadioGroup } from "@/components/ui/radio-group/radio-group";
export function Example() {
return (
<RadioGroup />
);
} 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/radio-group/radio-group.tsxcomponents/ui/radio-group/index.tsUpdate the import paths to match your project setup.
Usage
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group/radio-group"; <RadioGroup /> Also exported: RadioGroupItem.
Examples
The delivery-window step of a grocery checkout sheet in green.
import * as React from "react";
import { View } from "react-native";
import { Accent } from "@lumioui/core";
import { RadioGroup, RadioGroupItem } from "../radio-group";
import { ActionSwapText } from "../../action-swap/action-swap";
import { Button } from "../../button/button";
import { Icon, type IconName } from "../../icon/icon";
import { Text } from "../../text/text";
interface Slot {
value: string;
label: string;
note: string;
fee: number;
icon: IconName;
/** Short form for the confirm button. */
short: string;
}
const SLOTS: Slot[] = [
{ value: "tonight", label: "Today, 6–8pm", note: "Rider leaves Fernhill Market at 5:40", fee: 3.5, icon: "clock", short: "tonight" },
{ value: "morning", label: "Tomorrow morning", note: "8–11am · chilled bags kept cold", fee: 1.9, icon: "sun", short: "tomorrow" },
{ value: "locker", label: "Pickup at locker", note: "Locker 14, Mill Lane · ready by 4pm", fee: 0, icon: "package", short: "locker pickup" },
{ value: "express", label: "Within the hour", note: "No riders free nearby right now", fee: 6.9, icon: "zap", short: "express" },
];
const fee = (n: number) => (n === 0 ? "Free" : `€${n.toFixed(2)}`);
const SUBTOTAL = 42.6;
/** RadioDelivery — the delivery-window step of a grocery checkout sheet in
* green. Each window is a card row: the picked ring lights its row (a pool
* of accent light that settles faint), the border and wash crossfade, and
* the pay button's label swaps in place to the new window and total. The
* express window is out of riders and stays disabled. */
export function RadioDelivery() {
const [slot, setSlot] = React.useState("tonight");
const picked = SLOTS.find((s) => s.value === slot) ?? SLOTS[0]!;
const total = `€${(SUBTOTAL + picked.fee).toFixed(2)}`;
return (
<Accent color="green" className="w-full">
<View className="w-full gap-4 rounded-3xl bg-card p-5">
<View className="gap-1">
<Text className="text-2xl font-bold tracking-tight">When should it arrive?</Text>
<Text variant="muted">14 items · 22 Orchard Row, flat 3</Text>
</View>
<RadioGroup value={slot} onValueChange={setSlot} accessibilityLabel="Delivery window" className="gap-2">
{SLOTS.map((s) => (
<RadioGroupItem
key={s.value}
value={s.value}
label={s.label}
subtitle={s.note}
surface="card"
disabled={s.value === "express"}
indicatorPosition="trailing"
accessibilityLabel={`${s.label}, ${fee(s.fee)}`}
leading={
<View className="h-10 w-10 items-center justify-center rounded-xl bg-muted">
<Icon name={s.icon} size="sm" color="foreground" />
</View>
}
trailing={
<Text className="text-base font-semibold tabular-nums">{fee(s.fee)}</Text>
}
/>
))}
</RadioGroup>
<Button size="lg" className="w-full" accessibilityLabel={`Pay ${total}, ${picked.label}`}>
<ActionSwapText value={picked.value} className="text-[17px] font-semibold text-primary-foreground">
{`Pay ${total} · ${picked.short}`}
</ActionSwapText>
</Button>
</View>
</Accent>
);
} A music app's plan picker in pink.
import * as React from "react";
import { View } from "react-native";
import { Accent } from "@lumioui/core";
import { RadioGroup, RadioGroupItem } from "../radio-group";
import { ActionSwapText } from "../../action-swap/action-swap";
import { Button } from "../../button/button";
import { Text } from "../../text/text";
interface Plan {
value: string;
label: string;
price: string;
note: string;
save?: string;
}
const PLANS: Plan[] = [
{ value: "yearly", label: "Yearly", price: "$79.99/yr", note: "$6.67 a month, billed once", save: "Save 33%" },
{ value: "monthly", label: "Monthly", price: "$9.99/mo", note: "Cancel anytime" },
{ value: "family", label: "Family", price: "$14.99/mo", note: "Up to 6 accounts, one bill" },
];
/** RadioPayment — a music app's plan picker in pink. Plans are card rows:
* the picked ring lights its row, the border and accent wash crossfade on
* timing.normal, and the line under the CTA swaps in place to restate
* what you'll be charged. */
export function RadioPayment() {
const [plan, setPlan] = React.useState("yearly");
const picked = PLANS.find((p) => p.value === plan) ?? PLANS[0]!;
return (
<Accent color="pink" className="w-full">
<View className="w-full gap-5 rounded-3xl bg-card p-5">
<View className="gap-1">
<Text className="text-2xl font-bold tracking-tight">Try Lumio Pro free for 30 days</Text>
<Text variant="muted">Ad-free listening, offline downloads, lossless audio.</Text>
</View>
<RadioGroup value={plan} onValueChange={setPlan} accessibilityLabel="Plan" className="gap-2">
{PLANS.map((p) => {
return (
<RadioGroupItem
key={p.value}
value={p.value}
accessibilityLabel={`${p.label}, ${p.price}`}
indicatorPosition="trailing"
surface="card"
>
<View className="min-w-0 flex-1 gap-0.5">
<View className="flex-row items-center gap-2">
<Text className="text-base font-semibold">{p.label}</Text>
{p.save ? (
<View className="rounded-full bg-primary px-2 py-0.5">
<Text className="text-xs font-semibold text-primary-foreground">{p.save}</Text>
</View>
) : null}
</View>
<Text variant="muted" numberOfLines={1}>{p.note}</Text>
</View>
<Text className="text-base font-semibold tabular-nums">{p.price}</Text>
</RadioGroupItem>
);
})}
</RadioGroup>
<View className="gap-2">
<Button size="lg" className="w-full">Start free trial</Button>
<ActionSwapText value={picked.value} className="self-center text-center text-sm text-muted-foreground">
{`Then ${picked.price} after Nov 6. Cancel in Settings.`}
</ActionSwapText>
</View>
</View>
</Accent>
);
} API reference
RadioGroup
value string Controlled value. Omit with defaultValue for uncontrolled use.
—defaultValue string Uncontrolled initial value.
—onValueChange (value: string) => void — disabled boolean — className string — RadioGroupItem
value* string — label string — icon IconName Leading icon in the option row.
—subtitle string Secondary text under the label.
—leading React.ReactNode Custom leading node (brand mark, colour tile, artwork). Wins over icon.
trailing React.ReactNode Trailing node on the row's right edge (price, badge).
—indicatorPosition "leading" | "trailing" Put the ring on the trailing edge instead of the leading one — a settings-list layout where the row content leads and the control follows.
"leading" disabled boolean — className string — children React.ReactNode Custom content rendered next to the ring when label is absent.
surface "plain" | "card" "card" draws the option as a bordered row whose border and accent wash crossfade on pick and whose ring keeps a faint light. Default "plain".
"plain"