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.
Icon
Icon set drawn on one consistent grid, sized and coloured from your theme. The heart, star and bookmark can fill in place inside their outline, then fade back out.
Preview
import * as React from "react";
import { forwardRef } from "react";
import { View, Text, type ViewProps, type ColorValue } from "react-native";
import Svg, { Circle, Ellipse, G, Line, Path, Polygon, Polyline, Rect } from "react-native-svg";
import Animated, { Easing, useAnimatedStyle, useSharedValue, withSpring, withTiming } from "react-native-reanimated";
import { cn, createVariant, ease, spring, timing, useReducedMotion, useTheme, type ColorTokens } from "@lumioui/core";
import { GLYPHS, type GlyphNode } from "./glyphs";
/**
* Icon — the Lumio glyph set, sized and themed.
* <Icon name="check" size="md" />
* <Icon name="star" color="warning" filled />
* <Icon size="lg"><MyCustomSvg /></Icon>
*
* `filled` swaps in place: the fill ignites inside the stroke while the glyph
* settles 0.94→1; clearing dims the fill and the stroke stays. For full
* shape morphs (play → pause, menu → close) use <AnimatedIcon>.
*
* Geometry comes from packages/ui/src/animated-icons (the same drawings as
* <AnimatedIcon>, at rest), compiled by scripts/gen-icon-glyphs.mjs.
*/
export type IconName = keyof typeof GLYPHS;
export interface GlyphProps {
/** Rendered size in pt — the 24 grid scales to it. Default 24. */
size?: number;
color?: string;
/** Stroke width on the 24 grid — default 2. */
strokeWidth?: number;
/** Fill colour for the glyph's shapes; "none" (default) keeps it a stroke icon. */
fill?: string;
}
const SHAPES = { path: Path, circle: Circle, line: Line, rect: Rect, ellipse: Ellipse, polyline: Polyline, polygon: Polygon } as const;
function renderNode(node: GlyphNode, key: number, color: string, strokeWidth: number, fill: string): React.ReactNode {
const [tag, props, children] = node;
const { s, f, w, o, ...geometry } = props;
if (tag === "g") {
return (
<G key={key} transform={geometry.transform as string | undefined} opacity={o as number | undefined}>
{children?.map((c, i) => renderNode(c, i, color, strokeWidth, fill))}
</G>
);
}
const Shape = SHAPES[tag as keyof typeof SHAPES] as React.ComponentType<Record<string, unknown>> | undefined;
if (!Shape) return null;
return (
<Shape
key={key}
{...geometry}
stroke={s === 0 ? "none" : color}
strokeWidth={w != null ? (Number(w) * strokeWidth) / 2 : strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
fill={f ? color : fill}
opacity={o as number | undefined}
/>
);
}
function makeGlyph(name: IconName) {
const nodes = GLYPHS[name] as GlyphNode[];
const Glyph = React.memo(function Glyph({ size = 24, color = "currentColor", strokeWidth = 2, fill = "none" }: GlyphProps) {
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
{nodes.map((n, i) => renderNode(n, i, color, strokeWidth, fill))}
</Svg>
);
});
Glyph.displayName = `Glyph(${name})`;
return Glyph;
}
/** Every glyph as a standalone component — `iconMap.star` takes size / color / strokeWidth / fill. */
const iconMap = {} as Record<IconName, React.ComponentType<GlyphProps>>;
for (const n of Object.keys(GLYPHS) as IconName[]) iconMap[n] = makeGlyph(n);
/** Glyph scale the fill ignites from — the swap-in-place bloom. */
const FILL_BLOOM = 0.94;
/**
* FillableGlyph — a stroke glyph with its fill on its own layer, so turning
* `filled` on ignites the fill (timing.fast, ease.out) and clearing dims it
* (timing.recede, ease.in). The first render lands in its state without motion.
*/
function FillableGlyph({ name, size, color, strokeWidth, filled }: { name: IconName; size: number; color: string; strokeWidth: number; filled: boolean }) {
const reduce = useReducedMotion();
const Glyph = iconMap[name];
const lit = useSharedValue(filled ? 1 : 0);
const scale = useSharedValue(1);
const first = React.useRef(true);
React.useEffect(() => {
if (first.current) {
first.current = false;
return;
}
if (filled) {
lit.value = withTiming(1, { ...timing.fast, easing: Easing.bezier(...ease.out) });
if (!reduce) {
scale.value = FILL_BLOOM;
scale.value = withSpring(1, spring.swap);
}
} else {
lit.value = withTiming(0, { ...timing.recede, easing: Easing.bezier(...ease.in) });
}
}, [filled, reduce, lit, scale]);
const glyphStyle = useAnimatedStyle(() => ({ transform: [{ scale: scale.value }] }));
const fillStyle = useAnimatedStyle(() => ({ opacity: lit.value }));
return (
<Animated.View style={[{ width: size, height: size }, glyphStyle]}>
<Animated.View style={[{ position: "absolute", top: 0, left: 0 }, fillStyle]}>
<Glyph size={size} color={color} strokeWidth={0} fill={color} />
</Animated.View>
<Glyph size={size} color={color} strokeWidth={strokeWidth} fill="none" />
</Animated.View>
);
}
const iconVariants = createVariant({
base: "items-center justify-center",
variants: {
size: { sm: "h-4 w-4", md: "h-6 w-6", lg: "h-8 w-8", xl: "h-10 w-10" },
},
defaultVariants: { size: "md" },
});
const iconTextVariants = createVariant({
base: "text-foreground",
variants: {
size: { sm: "text-xs", md: "text-base", lg: "text-xl", xl: "text-2xl" },
},
defaultVariants: { size: "md" },
});
// md fills the 24pt grid the glyphs are drawn on, so the 2px stroke renders
// at exactly 2px — the weight every other glyph is tuned against.
const px = { sm: 16, md: 24, lg: 28, xl: 34 } as const;
// The set is drawn as strokes. Filling every glyph makes open shapes look
// muddy, so fill is opt-in only for glyphs with a deliberate filled state.
const FILLED_ICONS = new Set<IconName>(["heart", "star", "bookmark"]);
// Transport controls are solid by nature — outlined pause capsules read as "00".
const SOLID_ICONS = new Set<IconName>(["play", "pause"]);
export interface IconProps extends ViewProps {
/** Glyph name — e.g. "check", "chevron-down", "star". */
name?: IconName;
/** Color: a theme token ("foreground", "mutedForeground", "primary", …) or hex. */
color?: keyof ColorTokens | ColorValue;
/** Fill the glyph (heart, star, bookmark). */
filled?: boolean;
/** Stroke width — default 2. */
strokeWidth?: number;
/** Size preset. */
size?: "sm" | "md" | "lg" | "xl";
className?: string;
/** Extra classes for the glyph text (when children is a string). */
textClassName?: string;
/**
* Icons are decorative by default (hidden from screen readers). Provide a
* label for a standalone semantic icon — it is exposed with role "image".
*/
accessibilityLabel?: string;
/** Custom element (e.g. your own SVG) — overrides `name`. */
children?: React.ReactNode;
}
export const Icon = forwardRef<React.ElementRef<typeof View>, IconProps>(
function Icon(
{ name, color, filled, strokeWidth = 2, size = "md", className, textClassName, accessibilityLabel, children, ...props },
ref
) {
const { colors } = useTheme();
const colorKey =
typeof color === "string" ? color.replace(/-([a-z])/g, (_, ch: string) => ch.toUpperCase()) : undefined;
const resolved: ColorValue =
colorKey && colorKey in colors
? colors[colorKey as keyof ColorTokens]
: ((color ?? colors.foreground) as ColorValue);
const Glyph = name ? iconMap[name] : undefined;
// Labeled icons are exposed as images; unlabeled stay decorative/hidden.
const meaningful = accessibilityLabel != null;
return (
<View
ref={ref}
className={cn(iconVariants({ size }), className)}
accessibilityElementsHidden={!meaningful}
importantForAccessibility={meaningful ? "yes" : "no"}
aria-hidden={!meaningful}
accessibilityRole={meaningful ? "image" : undefined}
accessibilityLabel={accessibilityLabel}
{...props}
>
{Glyph && name && FILLED_ICONS.has(name) ? (
<FillableGlyph name={name} size={px[size]} color={resolved as string} strokeWidth={strokeWidth} filled={!!filled} />
) : Glyph ? (
<Glyph
size={px[size]}
color={resolved as string}
strokeWidth={strokeWidth}
fill={name && SOLID_ICONS.has(name) ? (resolved as string) : "none"}
/>
) : typeof children === "string" || typeof children === "number" ? (
<Text className={cn(iconTextVariants({ size }), textClassName)}>{children}</Text>
) : (
children
)}
</View>
);
}
);
Icon.displayName = "Icon";
export { iconVariants, iconMap }; import { Icon } from "@/components/ui/icon/icon";
export function Example() {
return (
<Icon />
);
} Installation
Usage
import { Icon } from "@/components/ui/icon/icon"; <Icon /> Examples
Icons where they earn their keep: the leading glyph of every mailbox row, in the app's ink.
import * as React from "react";
import { View } from "react-native";
import { AnimatedPressable, cn, useHaptic, usePressAnimation } from "@lumioui/core";
import { Icon, type IconName } from "../icon";
import { Text } from "../../text/text";
const MAILBOXES: { name: string; icon: IconName; count?: number }[] = [
{ name: "Inbox", icon: "mail", count: 12 },
{ name: "VIP", icon: "star", count: 3 },
{ name: "Flagged", icon: "flag", count: 1 },
{ name: "Drafts", icon: "file-text" },
{ name: "Sent", icon: "send" },
{ name: "Archive", icon: "archive" },
{ name: "Trash", icon: "trash" },
];
/** IconGallery — icons where they earn their keep: the leading glyph of
* every mailbox row, in the app's ink. Tap a
* mailbox to open it; the selected star fills. */
export function IconGallery() {
const [open, setOpen] = React.useState("Inbox");
return (
<View className="w-full">
<View className="w-full gap-3">
<View className="flex-row items-center justify-between px-1">
<Text className="text-3xl font-bold tracking-tight">Mailboxes</Text>
<Icon name="edit" size="md" color="primaryText" accessibilityLabel="New message" />
</View>
<View className="w-full overflow-hidden rounded-2xl bg-card">
{MAILBOXES.map((m, i) => (
<MailboxRow
key={m.name}
{...m}
first={i === 0}
selected={open === m.name}
onPress={() => setOpen(m.name)}
/>
))}
</View>
<Text variant="muted" className="px-4">Updated just now · 3 unread in VIP</Text>
</View>
</View>
);
}
function MailboxRow({
name,
icon,
count,
first,
selected,
onPress,
}: {
name: string;
icon: IconName;
count?: number;
first: boolean;
selected: boolean;
onPress: () => void;
}) {
const haptics = useHaptic();
const press = usePressAnimation();
return (
<AnimatedPressable
onPress={() => {
haptics.selection();
onPress();
}}
onPressIn={press.onPressIn}
onPressOut={press.onPressOut}
style={press.animatedStyle}
className={cn("min-h-12 flex-row items-center gap-3 pl-4", selected && "bg-secondary")}
accessibilityRole="button"
accessibilityLabel={count ? `${name}, ${count} unread` : name}
accessibilityState={{ selected }}
>
<Icon name={icon} size="md" color="primaryText" filled={icon === "star" && selected} />
<View
className={cn(
"min-h-12 flex-1 flex-row items-center gap-2 pr-4",
!first && "border-t border-border"
)}
>
<Text className="flex-1 text-base">{name}</Text>
{count ? <Text className="text-base text-muted-foreground tabular-nums">{count}</Text> : null}
<Icon name="chevron-right" size="sm" color="mutedForeground" />
</View>
</AnimatedPressable>
);
} Each size where it lives on a maps place sheet: xl in the category disc, md in the sheet toolbar, lg on the action tiles, sm in the metadata line.
import * as React from "react";
import { Pressable, View } from "react-native";
import { Accent, useHaptic } from "@lumioui/core";
import { Icon, type IconName } from "../icon";
import { Text } from "../../text/text";
import { ActionSwapText } from "../../action-swap/action-swap";
/** IconSizes — each size where it lives on a maps place sheet: xl in the
* category disc, md in the sheet toolbar, lg on the action tiles, sm in
* the metadata line. Tap Save and the fill ignites inside the bookmark
* while the label swaps to "Saved" in place; tap again and the fill dims. */
export function IconSizes() {
const haptics = useHaptic();
const [saved, setSaved] = React.useState(false);
const actions: { label: string; icon: IconName; onPress?: () => void; active?: boolean }[] = [
{ label: "Directions", icon: "car" },
{ label: "Call", icon: "phone" },
{ label: "Website", icon: "globe" },
{
label: saved ? "Saved" : "Save",
icon: "bookmark",
active: saved,
onPress: () => {
haptics.selection();
setSaved((s) => !s);
},
},
];
return (
<Accent color="orange" className="w-full">
<View className="w-full gap-5 rounded-3xl bg-card p-5">
<View className="flex-row items-start gap-3">
<View className="h-16 w-16 items-center justify-center rounded-full bg-tint-orange">
<Icon name="coffee" size="xl" color="#FFFFFF" />
</View>
<View className="flex-1 gap-1 pt-1">
<Text className="text-2xl font-bold tracking-tight">Juniper & Rye</Text>
<Text variant="muted">Coffee shop · Lumio Quarter</Text>
</View>
<View className="flex-row gap-2">
<View className="h-11 w-11 items-center justify-center rounded-full bg-secondary">
<Icon name="share" size="md" accessibilityLabel="Share place" />
</View>
<View className="h-11 w-11 items-center justify-center rounded-full bg-secondary">
<Icon name="x" size="md" accessibilityLabel="Close" />
</View>
</View>
</View>
<View className="flex-row gap-2">
{actions.map((a) => (
<Pressable
key={a.icon}
onPress={a.onPress}
className="h-16 flex-1 items-center justify-center gap-1 rounded-xl bg-secondary"
accessibilityRole="button"
accessibilityLabel={a.label}
accessibilityState={a.active != null ? { selected: a.active } : undefined}
>
<Icon name={a.icon} size="lg" color={a.active ? "primaryText" : "foreground"} filled={a.active} />
{a.onPress ? (
<ActionSwapText
value={a.label}
className={a.active ? "text-xs font-medium text-primary-text" : "text-xs font-medium text-foreground"}
>
{a.label}
</ActionSwapText>
) : (
<Text className="text-xs font-medium">{a.label}</Text>
)}
</Pressable>
))}
</View>
<View className="flex-row items-center gap-4 border-t border-border pt-4">
<View className="flex-row items-center gap-1">
<Icon name="star" size="sm" color="foreground" filled />
<Text className="text-sm font-medium tabular-nums">4.7</Text>
<Text variant="muted">(312)</Text>
</View>
<View className="flex-row items-center gap-1">
<Icon name="clock" size="sm" color="success" />
<Text className="text-sm">Open until 4 PM</Text>
</View>
<View className="flex-row items-center gap-1">
<Icon name="map-pin" size="sm" color="mutedForeground" />
<Text variant="muted">0.6 mi</Text>
</View>
</View>
</View>
</Accent>
);
} API reference
Glyph
size number Rendered size in pt — the 24 grid scales to it. Default 24.
—color string — strokeWidth number Stroke width on the 24 grid — default 2.
—fill string Fill colour for the glyph's shapes; "none" (default) keeps it a stroke icon.
—Icon
name IconName Glyph name — e.g. "check", "chevron-down", "star".
—color keyof ColorTokens | ColorValue Color: a theme token ("foreground", "mutedForeground", "primary", …) or hex.
—filled boolean Fill the glyph (heart, star, bookmark).
—strokeWidth number Stroke width — default 2.
2 size "sm" | "md" +2
"sm" | "md" | "lg" | "xl" Size preset.
"md" className string — textClassName string Extra classes for the glyph text (when children is a string).
—accessibilityLabel string Icons are decorative by default (hidden from screen readers). Provide a label for a standalone semantic icon — it is exposed with role "image".
—children React.ReactNode Custom element (e.g. your own SVG) — overrides name.