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.
Separator
Thin divider line, horizontal or vertical. It can draw itself in as a page builds, or show a perforated tear line for tickets and receipts.
Preview
import * as React from "react";
import { forwardRef } from "react";
import { View, type ViewProps } from "react-native";
import Animated, { Easing, useAnimatedStyle, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
import Svg, { Line } from "react-native-svg";
import { cn, ease, timing, useReducedMotion, useTheme } from "@lumioui/core";
export interface SeparatorProps extends ViewProps {
orientation?: "horizontal" | "vertical";
/**
* Hide the rule from assistive tech (default true). Set `decorative={false}`
* to expose it as a semantic separator — e.g. when it carries meaning
* between landmark sections rather than pure decoration.
*/
decorative?: boolean;
/**
* Draw the rule on mount: it grows from its leading edge (top for vertical)
* so a receipt or page build reads as structure switching on. Default false.
*/
draw?: boolean;
/** With `draw`: wait before drawing, in ms — use the rule's band slot (e.g. 120 × band). */
drawDelay?: number;
/**
* Perforated tear line — a row of punched holes for tickets, passes and
* receipt stubs, instead of the hairline. Default false.
*/
perforated?: boolean;
className?: string;
}
/** Hole pitch and size of the perforated line, in points. */
const HOLE_GAP = 6;
const HOLE_SIZE = 2;
/** Holes sit a step lighter than body ink so the line reads as punched, not printed. */
const HOLE_ALPHA = 0.45;
/** The drawn or perforated rule — only these opt-in looks pay for theme and motion hooks. */
function RuleFace({ horizontal, draw, drawDelay, perforated }: { horizontal: boolean; draw: boolean; drawDelay: number; perforated: boolean }) {
const { colors } = useTheme();
const reduce = useReducedMotion();
const p = useSharedValue(draw ? 0 : 1);
React.useEffect(() => {
if (!draw) return;
// The hairline grows from its leading edge on the ignite curve.
p.value = withDelay(drawDelay, withTiming(1, { ...timing.normal, easing: Easing.bezier(...ease.out) }));
}, [draw, drawDelay, p]);
// Reduced motion: the rule switches on in place (opacity only, no growth).
const drawStyle = useAnimatedStyle(() =>
reduce
? { opacity: p.value }
: { opacity: Math.min(1, p.value * 3), transform: [horizontal ? { scaleX: p.value } : { scaleY: p.value }] }
);
const origin = { transformOrigin: horizontal ? "left" : "top" } as const;
return (
<Animated.View
className={cn("absolute inset-0", perforated ? "" : "bg-border")}
style={draw ? [origin, drawStyle] : undefined}
>
{perforated ? (
<Svg width="100%" height="100%">
<Line
x1={horizontal ? HOLE_SIZE : "50%"}
y1={horizontal ? "50%" : HOLE_SIZE}
x2={horizontal ? "100%" : "50%"}
y2={horizontal ? "50%" : "100%"}
stroke={colors.mutedForeground}
strokeOpacity={HOLE_ALPHA}
strokeWidth={HOLE_SIZE}
strokeLinecap="round"
strokeDasharray={`0.01 ${HOLE_GAP}`}
/>
</Svg>
) : null}
</Animated.View>
);
}
export const Separator = forwardRef<React.ElementRef<typeof View>, SeparatorProps>(
function Separator(
{ orientation = "horizontal", decorative = true, draw = false, drawDelay = 0, perforated = false, className, style, ...props },
ref
) {
const horizontal = orientation === "horizontal";
const a11y = {
// Decorative rule — hidden from the a11y tree (divider pattern).
// When decorative={false} it's exposed with role "separator" (RN's
// accessibilityRole union lacks "separator" — `role` is the typed
// path; RNW forwards it as the ARIA role).
// RNW ignores accessibilityElementsHidden, so aria-hidden too.
accessible: !decorative,
accessibilityElementsHidden: decorative,
importantForAccessibility: decorative ? ("no" as const) : ("yes" as const),
"aria-hidden": decorative,
role: decorative ? undefined : ("separator" as const),
};
// The plain hairline renders exactly as it always has.
if (!draw && !perforated) {
return (
<View
ref={ref}
className={cn("bg-border shrink-0", horizontal ? "h-px w-full" : "h-full w-px", className)}
{...a11y}
style={style}
{...props}
/>
);
}
return (
<View
ref={ref}
className={cn(
"shrink-0",
horizontal ? (perforated ? "h-1 w-full" : "h-px w-full") : perforated ? "h-full w-1" : "h-full w-px",
className
)}
{...a11y}
style={style}
{...props}
>
<RuleFace horizontal={horizontal} draw={draw} drawDelay={drawDelay} perforated={perforated} />
</View>
);
}
);
Separator.displayName = "Separator"; import { Separator } from "@/components/ui/separator/separator";
export function Example() {
return (
<Separator />
);
} Installation
Install the dependencies
npx expo install react-native-reanimated react-native-svgCopy the source from the Code tab into your project
components/ui/separator/separator.tsxcomponents/ui/separator/index.tsUpdate the import paths to match your project setup.
Usage
import { Separator } from "@/components/ui/separator/separator"; <Separator /> Examples
Hairline rules grouping a ride receipt: who drove, what it cost, how it was paid.
import * as React from "react";
import { Image, Pressable, View } from "react-native";
import { BAND_STAGGER, SwitchOn } from "@lumioui/core";
import { Separator } from "../separator";
import { Text } from "../../text/text";
const FARE: [string, string][] = [
["Trip fare · 7.8 mi, 22 min", "$17.40"],
["Booking fee", "$2.35"],
["Airport surcharge", "$4.00"],
];
const TIPS = [0, 2, 3, 5];
/** SeparatorReceipt — hairline rules grouping a ride receipt: who drove,
* what it cost, how it was paid. The receipt prints as structure switching
* on: each band lights 120ms after the last and each rule draws from its
* leading edge in its band slot; a perforated tear line sets off the stub.
* The tip row is live, so the total under the last rule updates. Neutral ink. */
export function SeparatorReceipt() {
const [tip, setTip] = React.useState(3);
const total = 17.4 + 2.35 + 4 + tip;
return (
<View className="w-full gap-4 rounded-3xl bg-card p-5">
<SwitchOn className="flex-row items-center gap-3">
<Image
source={{ uri: "https://i.pravatar.cc/150?img=60" }}
className="h-12 w-12 rounded-full bg-muted"
accessibilityIgnoresInvertColors
/>
<View className="flex-1">
<Text className="text-[17px] font-semibold">Ride with Kwame</Text>
<Text variant="muted">Grey hybrid · 7KJR 204 · Tue 6:42 PM</Text>
</View>
</SwitchOn>
<Separator draw drawDelay={BAND_STAGGER} />
<SwitchOn delay={BAND_STAGGER} className="gap-3">
{FARE.map(([label, amt]) => (
<View key={label} className="flex-row justify-between gap-3">
<Text className="flex-1 text-[15px] text-muted-foreground">{label}</Text>
<Text className="text-[15px] tabular-nums">{amt}</Text>
</View>
))}
<View className="flex-row items-center justify-between gap-3">
<Text className="text-[15px] text-muted-foreground">Tip</Text>
<View className="flex-row gap-1">
{TIPS.map((t) => (
<Pressable
key={t}
onPress={() => setTip(t)}
hitSlop={6}
accessibilityRole="button"
accessibilityLabel={t === 0 ? "No tip" : `Tip $${t}`}
accessibilityState={{ selected: tip === t }}
className={`h-8 min-w-[48px] items-center justify-center rounded-full px-3 ${
tip === t ? "bg-primary" : "bg-secondary"
}`}
>
<Text
className={`text-sm font-medium tabular-nums ${
tip === t ? "text-primary-foreground" : "text-secondary-foreground"
}`}
>
{t === 0 ? "None" : `$${t}`}
</Text>
</Pressable>
))}
</View>
</View>
</SwitchOn>
<Separator draw drawDelay={BAND_STAGGER * 2} />
<SwitchOn delay={BAND_STAGGER * 2} className="flex-row items-baseline justify-between">
<Text className="text-[17px] font-semibold">Total</Text>
<Text className="text-3xl font-semibold tracking-tight tabular-nums">${total.toFixed(2)}</Text>
</SwitchOn>
<Separator perforated draw drawDelay={BAND_STAGGER * 3} className="my-1" />
<SwitchOn delay={BAND_STAGGER * 3}>
<Text variant="muted">Charged to card •• 7731 · Receipt sent to your email</Text>
</SwitchOn>
</View>
);
} Vertical rules splitting a note editor's formatting bar into groups (format · insert · voice), the notes keyboard-bar idiom.
import * as React from "react";
import { Pressable, View } from "react-native";
import { ROW_STAGGER, useHaptic } from "@lumioui/core";
import { Separator } from "../separator";
import { Icon, type IconName } from "../../icon/icon";
import { Text } from "../../text/text";
type Tool = { icon: IconName; label: string; toggle?: boolean };
const GROUPS: Tool[][] = [
[
{ icon: "type", label: "Text style" },
{ icon: "list", label: "Bulleted list", toggle: true },
{ icon: "check-circle", label: "Checklist", toggle: true },
],
[
{ icon: "image", label: "Insert photo" },
{ icon: "paperclip", label: "Attach file" },
],
[{ icon: "mic", label: "Dictate", toggle: true }],
];
function ToolButton({ tool, on, onPress }: { tool: Tool; on: boolean; onPress: () => void }) {
return (
<Pressable
onPress={onPress}
className={`h-11 w-11 items-center justify-center rounded-xl ${on ? "bg-secondary" : ""}`}
accessibilityRole="button"
accessibilityLabel={tool.label}
accessibilityState={tool.toggle ? { selected: on } : undefined}
>
<Icon name={tool.icon} size="md" color={on ? "foreground" : "mutedForeground"} />
</Pressable>
);
}
/** SeparatorVertical — vertical rules splitting a note editor's formatting
* bar into groups (format · insert · voice), the notes keyboard-bar
* idiom. The group rules draw top-down as the bar arrives, 40ms apart.
* List and checklist are mutually exclusive toggles. */
export function SeparatorVertical() {
const haptics = useHaptic();
const [active, setActive] = React.useState<string[]>(["Checklist"]);
const press = (t: Tool) => {
haptics.selection();
if (!t.toggle) return;
setActive((a) => {
if (a.includes(t.label)) return a.filter((x) => x !== t.label);
const rest = a.filter((x) => x !== "Bulleted list" && x !== "Checklist");
return t.label === "Dictate" ? [...a, t.label] : [...rest, t.label];
});
};
const checklist = active.includes("Checklist");
const bullets = active.includes("Bulleted list");
const items = ["Confirm caterer headcount (34)", "Book the Ridgeline cabins", "Print name badges"];
return (
<View className="w-full overflow-hidden rounded-3xl bg-card">
<View className="gap-3 p-5">
<Text className="text-2xl font-bold tracking-tight">Team offsite</Text>
<Text variant="muted">Edited just now</Text>
<View className="gap-2 pt-1">
{items.map((it, i) => (
<View key={it} className="flex-row items-center gap-3">
{checklist ? (
<View
className={`h-5 w-5 items-center justify-center rounded-full ${
i === 0 ? "bg-primary" : "border border-input"
}`}
>
{i === 0 ? <Icon name="check" size="sm" color="primaryForeground" strokeWidth={3} /> : null}
</View>
) : bullets ? (
<View className="mx-2 h-1 w-1 rounded-full bg-foreground" />
) : null}
<Text
className={`flex-1 text-base ${checklist && i === 0 ? "text-muted-foreground line-through" : ""}`}
>
{it}
</Text>
</View>
))}
</View>
{active.includes("Dictate") ? (
<Text className="text-sm text-primary-text">Listening…</Text>
) : null}
</View>
<View className="flex-row items-center gap-1 border-t border-border px-2 py-1">
{GROUPS.map((group, gi) => (
<React.Fragment key={gi}>
{gi > 0 ? <Separator orientation="vertical" draw drawDelay={gi * ROW_STAGGER} className="mx-1 h-6" /> : null}
{group.map((t) => (
<ToolButton key={t.label} tool={t} on={active.includes(t.label)} onPress={() => press(t)} />
))}
</React.Fragment>
))}
<View className="flex-1" />
<ToolButton tool={{ icon: "chevron-down", label: "Hide keyboard" }} on={false} onPress={() => haptics.light()} />
</View>
</View>
);
} API reference
orientation "horizontal" | "vertical" "horizontal" decorative boolean Hide the rule from assistive tech (default true). Set decorative={false} to expose it as a semantic separator — e.g. when it carries meaning between landmark sections rather than pure decoration.
true draw boolean Draw the rule on mount: it grows from its leading edge (top for vertical) so a receipt or page build reads as structure switching on. Default false.
false drawDelay number With draw: wait before drawing, in ms — use the rule's band slot (e.g. 120 × band).
0 perforated boolean Perforated tear line — a row of punched holes for tickets, passes and receipt stubs, instead of the hairline. Default false.
false className string —