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.
Chip
Compact pill for filters, suggestions, tags and inputs, in solid, outline and glass styles. Selecting a chip fills it quickly and it settles into place without a bounce.
Preview
import * as React from "react";
import { forwardRef } from "react";
import { Pressable, Text, type PressableProps, type GestureResponderEvent } from "react-native";
import Animated, {
Easing,
useSharedValue,
useAnimatedStyle,
withSequence,
withSpring,
withTiming,
} from "react-native-reanimated";
import { cn, createVariant, ease, useAsyncPress, useHaptic, usePressAnimation, useReducedMotion, spring, timing, } from "@lumioui/core";
/** Selection is light: the fill switches on fast and dims faster (§5c rule 6). */
const FILL_ON = { ...timing.fast, easing: Easing.bezier(...ease.out) };
const FILL_OFF = { ...timing.recede, easing: Easing.bezier(...ease.in) };
/** The chip settles from a hair under size as its fill ignites — no overshoot on chrome. */
const IGNITE_FROM = 0.96;
import { Icon } from "../icon";
import { Glass } from "../glass";
const chipVariants = createVariant({
base: "flex-row items-center rounded-full",
variants: {
variant: {
assist: "bg-secondary",
filter: "border border-input bg-transparent",
input: "bg-card border border-input",
suggestion: "bg-accent",
glass: "",
},
// Selected = solid ink (or the scoped <Accent>) — the filter-chip
// idiom. A 10% tint on a hairline read as "almost selected".
selected: {
// The fill itself is a layer that switches on (see `fillStyle`).
true: "border-primary",
false: "",
},
// Fixed heights so chips align with 36/44 controls: sm 32, md 36.
size: {
sm: "h-8 px-3 gap-1",
md: "h-9 px-3.5 gap-1.5",
},
},
defaultVariants: { variant: "assist", selected: "false", size: "md" },
});
const chipTextVariants = createVariant({
base: "font-medium",
variants: {
variant: {
assist: "text-secondary-foreground",
filter: "text-foreground",
input: "text-foreground",
suggestion: "text-accent-foreground",
glass: "text-foreground",
},
selected: {
true: "text-primary-foreground",
false: "",
},
size: {
sm: "text-[13px]",
md: "text-[15px]",
},
},
defaultVariants: { variant: "assist", selected: "false", size: "md" },
});
export interface ChipProps extends Omit<PressableProps, "children" | "onPress"> {
/** Chip visual intent — "glass" renders a glass pill. */
variant?: "assist" | "filter" | "input" | "suggestion" | "glass";
/** Density preset — "sm" for dense rails (filters, metadata tags). */
size?: "sm" | "md";
/** Controlled selected / active state. Omit for uncontrolled use with
* `defaultSelected`/`onSelectedChange`. */
selected?: boolean;
/** Initial selected state for uncontrolled use. Chips that opt into
* uncontrolled selection (via this prop or `onSelectedChange`) toggle
* themselves on press; plain action chips keep their current behavior. */
defaultSelected?: boolean;
/** Called when the user toggles selection. In controlled mode this is the
* change intent; in uncontrolled mode it also fires after the internal
* state flips. */
onSelectedChange?: (selected: boolean) => void;
/** Called on press. May return a Promise — when `asyncTracking` is on the
* chip enters its loading state until the promise resolves. */
onPress?: (e: GestureResponderEvent) => void | Promise<unknown>;
/** Delete handler — shows a trailing × button. */
onDelete?: () => void;
/** Leading icon or avatar. */
icon?: React.ReactNode;
/** Extra classes for the label. */
textClassName?: string;
/** Extra classes for the container. */
className?: string;
/** Extra classes for the container applied only while `selected` — the
* escape hatch for accent-idiom fills (e.g. a lime pill on a dark canvas)
* that the primary-tinted selected variant can't express. */
selectedClassName?: string;
/** Extra classes for the label applied only while `selected`. */
selectedTextClassName?: string;
/** Auto-track async onPress — when onPress returns a Promise, the chip
* automatically enters loading state until it resolves. Default true. */
asyncTracking?: boolean;
children?: React.ReactNode;
}
// Animated.View is cssInterop-registered via @lumioui/core/styled
/** Chip — assist/filter/input/suggestion with press animation and haptics. */
export const Chip = forwardRef<React.ElementRef<typeof Pressable>, ChipProps>(
function Chip(
{
variant = "assist",
size = "md",
selected,
defaultSelected,
onSelectedChange,
onDelete,
icon,
textClassName,
className,
selectedClassName,
selectedTextClassName,
onPress,
disabled,
asyncTracking = true,
children,
...props
},
ref
) {
const haptics = useHaptic();
const press = usePressAnimation({ pressedScale: 0.96 });
// The × is a small nested target — deeper dip + opacity so the touch reads.
const deletePress = usePressAnimation({ pressedScale: 0.8, pressedOpacity: 0.5 });
const reduceMotion = useReducedMotion();
// Controlled when `selected` is passed; uncontrolled selection only kicks
// in when the consumer opts in (defaultSelected/onSelectedChange) so plain
// action chips never self-highlight.
const isControlled = selected !== undefined;
const isSelectable = defaultSelected !== undefined || onSelectedChange !== undefined;
const [internalSelected, setInternalSelected] = React.useState(defaultSelected ?? false);
const isSelected = isControlled ? selected : internalSelected;
const selectedKey = isSelected ? "true" : ("false" as const);
// Selection ignites: the accent fill switches on beneath the label and the
// chip settles from a hair under size; deselecting dims it out.
const selectPulse = useSharedValue(1);
const fill = useSharedValue(isSelected ? 1 : 0);
const firstRender = React.useRef(true);
React.useEffect(() => {
if (firstRender.current) {
firstRender.current = false;
return;
}
fill.value = withTiming(isSelected ? 1 : 0, isSelected ? FILL_ON : FILL_OFF);
if (reduceMotion || !isSelected) return;
selectPulse.value = withSequence(withTiming(IGNITE_FROM, timing.instant), withSpring(1, spring.swap));
}, [isSelected, selectPulse, fill, reduceMotion]);
const fillStyle = useAnimatedStyle(() => ({ opacity: fill.value }));
// press.scale and the selection pulse share one transform slot.
const chipStyle = useAnimatedStyle(() => ({
transform: [{ scale: press.scale.value * selectPulse.value }],
}));
// Auto-track async onPress promises
const asyncPress = useAsyncPress(
asyncTracking ? onPress : undefined,
{
haptic: () => haptics.selection(),
}
);
const isLoading = asyncPress.loading;
const isDisabled = disabled || isLoading;
// Held-state ink overlay — a faint wash that confirms contact instantly.
const ink = useSharedValue(0);
const inkStyle = useAnimatedStyle(() => ({ opacity: ink.value * 0.12 }));
const handlePress = (e: GestureResponderEvent) => {
if (!isControlled && isSelectable) setInternalSelected(!isSelected);
onSelectedChange?.(!isSelected);
if (asyncTracking) {
asyncPress.handlePress(e);
} else {
haptics.selection();
onPress?.(e);
}
};
const handlePressIn = (_e: GestureResponderEvent) => {
press.onPressIn();
if (!reduceMotion) ink.value = withTiming(1, timing.instant);
};
const handlePressOut = () => {
press.onPressOut();
ink.value = withTiming(0, timing.normal);
};
const handleDelete = (e: GestureResponderEvent) => {
e.stopPropagation?.();
haptics.light();
onDelete?.();
};
return (
<Animated.View
style={chipStyle}
className={cn(
// overflow-hidden clips the square ink wash to the pill shape.
"overflow-hidden",
chipVariants({ variant, selected: selectedKey, size }),
isDisabled && "opacity-50",
className,
isSelected && selectedClassName
)}
>
{/* Selected glass chips drop the glass for the solid fill — a tinted
pane over a photo can't carry a selected state legibly. */}
{variant === "glass" && !isSelected ? (
<Glass
effect="clear"
sheen={0.5}
className="absolute inset-0 rounded-full"
pointerEvents="none"
/>
) : null}
{/* Selected fill — switches on beneath the label. */}
<Animated.View
pointerEvents="none"
className="bg-primary"
style={[{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }, fillStyle]}
/>
{/* Ink overlay — held state. Lives on the outer pill so the wash
covers the full chip (padding included), not just the content row. */}
<Animated.View
pointerEvents="none"
className="bg-foreground"
style={[
{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 },
inkStyle,
]}
/>
<Pressable
ref={ref}
disabled={isDisabled}
onPress={handlePress}
onPressIn={handlePressIn}
onPressOut={handlePressOut}
className="h-full flex-row items-center gap-1.5"
accessibilityRole="button"
accessibilityState={{ selected: isSelected, disabled: isDisabled, busy: isLoading }}
// accessibilityState isn't forwarded to the DOM on web — mirror it
// with explicit aria-* like Switch/Toggle do.
aria-pressed={isSelected}
aria-disabled={isDisabled}
aria-busy={isLoading}
// 36pt visual height (32 sm) + 2×12 hitSlop clears the 44pt floor.
hitSlop={12}
{...props}
>
{icon}
<Text
className={cn(
chipTextVariants({ variant, selected: selectedKey, size }),
textClassName,
isSelected && selectedTextClassName
)}
>
{children}
</Text>
</Pressable>
{onDelete ? (
<Pressable
onPress={handleDelete}
onPressIn={deletePress.onPressIn}
onPressOut={deletePress.onPressOut}
// isDisabled (not disabled) — the × must also lock during the
// async onPress loading window, same as the chip body.
disabled={isDisabled}
className="ml-0.5 h-5 w-5 items-center justify-center rounded-full"
accessibilityRole="button"
accessibilityLabel="Remove chip"
hitSlop={12}
>
<Animated.View style={deletePress.animatedStyle}>
<Icon name="x" size="sm" color={isSelected ? "primaryForeground" : "mutedForeground"} />
</Animated.View>
</Pressable>
) : null}
</Animated.View>
);
}
);
Chip.displayName = "Chip"; import { Chip } from "@/components/ui/chip/chip";
export function Example() {
return (
<Chip />
);
} Installation
Usage
import { Chip } from "@/components/ui/chip/chip"; <Chip /> Examples
A rentals search filter rail.
import * as React from "react";
import { Image, ScrollView, View } from "react-native";
import { Chip } from "../chip";
import { Icon } from "../../icon/icon";
import { Text } from "../../text/text";
type Filter = "pets" | "laundry" | "parking" | "furnished" | "balcony";
const FILTERS: { key: Filter; label: string; cut: number }[] = [
{ key: "pets", label: "Pets allowed", cut: 71 },
{ key: "laundry", label: "In-unit laundry", cut: 58 },
{ key: "parking", label: "Parking", cut: 33 },
{ key: "furnished", label: "Furnished", cut: 96 },
{ key: "balcony", label: "Balcony", cut: 44 },
];
const HOMES = [
{
title: "2 bd · 1 ba · 840 sq ft",
street: "418 Hawthorne Ave",
rent: "$2,150",
photo: "https://images.unsplash.com/photo-1590490360182-c33d57733427?w=240&h=240&fit=crop&q=70&auto=format",
},
{
title: "1 bd · 1 ba · 610 sq ft",
street: "77 Alder St, unit 4",
rent: "$1,725",
photo: "https://images.unsplash.com/photo-1542309175-9b88d743f89f?w=240&h=240&fit=crop&q=70&auto=format",
},
];
/** ChipFilters — a rentals search filter rail. Chips are multi-select and
* the result count answers every tap, the way a real listings app does. */
export function ChipFilters() {
const [on, setOn] = React.useState<Filter[]>(["pets"]);
const toggle = (k: Filter) =>
setOn((cur) => (cur.includes(k) ? cur.filter((x) => x !== k) : [...cur, k]));
const count = FILTERS.reduce((n, f) => (on.includes(f.key) ? n - f.cut : n), 384);
return (
<View className="w-full gap-4">
<View className="gap-1 px-1">
<Text className="text-2xl font-bold tracking-tight">Portland, OR</Text>
<Text variant="muted">Up to $2,400 · 1+ bedrooms</Text>
</View>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
className="-mx-4"
contentContainerStyle={{ gap: 8, paddingHorizontal: 16 }}
>
<Chip
variant="filter"
accessibilityLabel={on.length > 0 ? "Clear filters" : "All filters"}
icon={<Icon name={on.length > 0 ? "x" : "settings"} size="sm" color="foreground" />}
onPress={() => setOn([])}
>
{on.length > 0 ? `Clear ${on.length}` : "Filters"}
</Chip>
{FILTERS.map((f) => (
<Chip
key={f.key}
variant="filter"
selected={on.includes(f.key)}
onPress={() => toggle(f.key)}
>
{f.label}
</Chip>
))}
</ScrollView>
<Text className="px-1 text-[15px] font-semibold tabular-nums">{count} homes</Text>
<View className="overflow-hidden rounded-2xl bg-card">
{HOMES.map((h, i) => (
<View
key={h.street}
className={`flex-row items-center gap-3 p-3 ${i > 0 ? "border-t border-border" : ""}`}
>
<Image
source={{ uri: h.photo }}
className="h-16 w-16 rounded-xl bg-muted"
accessibilityIgnoresInvertColors
/>
<View className="flex-1">
<Text className="text-[15px] font-medium">{h.title}</Text>
<Text variant="muted" numberOfLines={1}>{h.street}</Text>
</View>
<Text className="text-[15px] font-semibold tabular-nums">{h.rent}</Text>
</View>
))}
</View>
</View>
);
} Glass map-layer chips floating over the trail photo they filter (glass only because it sits on imagery).
import * as React from "react";
import { Image, StyleSheet, View, ScrollView } from "react-native";
import { Chip } from "../chip";
import { Icon } from "../../icon/icon";
import { Text } from "../../text/text";
const PHOTO =
"https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=800&h=1000&fit=crop&q=70&auto=format";
/** `label` is the chip (short, so all four fit one row with the 16pt
* gutters); `noun` is what the info card counts. */
type Layer = { label: string; noun: string; count: number; nearest: string };
const TRAILS: Layer = { label: "Trails", noun: "trails", count: 42, nearest: "Wildwood Loop · 6.4 mi" };
const LAYERS: Layer[] = [
TRAILS,
{ label: "Camps", noun: "campsites", count: 9, nearest: "Cedar Flat · 2.1 mi away" },
{ label: "Falls", noun: "waterfalls", count: 6, nearest: "Bridal Veil Falls · 0.8 mi" },
{ label: "Views", noun: "viewpoints", count: 14, nearest: "Pittock Overlook · 3.2 mi" },
];
/** ChipGlass — glass map-layer chips floating over the trail photo they
* filter (glass only because it sits on imagery). The selected chip goes
* solid ink; the info card below answers the tap. */
export function ChipGlass() {
const [sel, setSel] = React.useState("Trails");
const layer = LAYERS.find((l) => l.label === sel) ?? TRAILS;
return (
<View className="relative h-[460px] w-full overflow-hidden rounded-3xl bg-muted">
<Image
source={{ uri: PHOTO }}
style={StyleSheet.absoluteFill}
resizeMode="cover"
accessibilityIgnoresInvertColors
/>
<View className="absolute inset-x-0 top-4">
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
contentContainerStyle={{ paddingHorizontal: 16, gap: 8 }}
>
{LAYERS.map((l) => (
<Chip
key={l.label}
variant="glass"
selected={sel === l.label}
onPress={() => setSel(l.label)}
>
{l.label}
</Chip>
))}
</ScrollView>
</View>
<View className="absolute inset-x-4 bottom-4 flex-row items-center gap-3 rounded-2xl bg-card p-4">
<View className="h-11 w-11 items-center justify-center rounded-full bg-tint-green">
<Icon name="footprints" size="sm" color="#FFFFFF" />
</View>
<View className="flex-1">
<Text className="text-[15px] font-semibold">
{layer.count} {layer.noun} in Forest Park
</Text>
<Text variant="muted" numberOfLines={1}>Nearest: {layer.nearest}</Text>
</View>
</View>
</View>
);
} Invitee chips in a "Share document" sheet.
import * as React from "react";
import { Image, View } from "react-native";
import { Accent } from "@lumioui/core";
import { Chip } from "../chip";
import { Button } from "../../button/button";
import { Icon } from "../../icon/icon";
import { Text } from "../../text/text";
const PEOPLE = [
{ name: "Hana Sato", img: 32 },
{ name: "Mateo Alvarez", img: 12 },
{ name: "Grace Liu", img: 45 },
{ name: "Ola Bergström", img: 59 },
];
/** ChipRemovable — invitee chips in a "Share document" sheet. Each person is
* an input chip with their avatar; × removes them and the CTA count
* follows. Orange for a productivity tool. */
export function ChipRemovable() {
const [people, setPeople] = React.useState(PEOPLE);
const remove = (name: string) => setPeople((p) => p.filter((x) => x.name !== name));
const n = people.length;
return (
<Accent color="orange" className="w-full">
<View className="w-full gap-5 rounded-3xl bg-card p-5">
<View className="flex-row items-center gap-3">
<View className="h-11 w-11 items-center justify-center rounded-xl bg-tint-orange">
<Icon name="file-text" size="sm" color="#FFFFFF" />
</View>
<View className="flex-1">
<Text className="text-[17px] font-semibold" numberOfLines={1}>Q4 hiring plan</Text>
<Text variant="muted">Invited people can comment</Text>
</View>
</View>
<View className="min-h-[52px] flex-row flex-wrap items-center gap-2 rounded-xl border border-border p-2">
{people.map((p) => (
<Chip
key={p.name}
variant="input"
className="pl-1"
onDelete={() => remove(p.name)}
accessibilityLabel={p.name}
icon={
<Image
source={{ uri: `https://i.pravatar.cc/150?img=${p.img}` }}
className="h-7 w-7 rounded-full bg-muted"
accessibilityIgnoresInvertColors
/>
}
>
{p.name}
</Chip>
))}
<Text variant="muted" className="px-2">
{n === 0 ? "Add people or groups" : "Add more"}
</Text>
</View>
<Button size="lg" className="w-full" disabled={n === 0}>
{n === 0 ? "Invite" : `Invite ${n} ${n === 1 ? "person" : "people"}`}
</Button>
</View>
</Accent>
);
} API reference
variant "assist" | "filter" +3
"assist" | "filter" | "input" | "suggestion" | "glass" Chip visual intent — "glass" renders a glass pill.
"assist" size "sm" | "md" Density preset — "sm" for dense rails (filters, metadata tags).
"md" selected boolean Controlled selected / active state. Omit for uncontrolled use with defaultSelected/onSelectedChange.
defaultSelected boolean Initial selected state for uncontrolled use. Chips that opt into uncontrolled selection (via this prop or onSelectedChange) toggle themselves on press; plain action chips keep their current behavior.
onSelectedChange (selected: boolean) => void Called when the user toggles selection. In controlled mode this is the change intent; in uncontrolled mode it also fires after the internal state flips.
—onPress (e: GestureResponderEvent) => void …
(e: GestureResponderEvent) => void | Promise<unknown> Called on press. May return a Promise — when asyncTracking is on the chip enters its loading state until the promise resolves.
onDelete () => void Delete handler — shows a trailing × button.
—icon React.ReactNode Leading icon or avatar.
—textClassName string Extra classes for the label.
—className string Extra classes for the container.
—selectedClassName string Extra classes for the container applied only while selected — the escape hatch for accent-idiom fills (e.g. a lime pill on a dark canvas) that the primary-tinted selected variant can't express.
selectedTextClassName string Extra classes for the label applied only while selected.
asyncTracking boolean Auto-track async onPress — when onPress returns a Promise, the chip automatically enters loading state until it resolves. Default true.
true children React.ReactNode —