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.
Divider
Thin line that separates content, horizontal or vertical, with an optional centred label. An optional soft style fades the lines from the edges toward the label, and can brighten them.
Preview
import * as React from "react";
import { forwardRef } from "react";
import { View, Text, type ViewProps } from "react-native";
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
import { cn, ease, timing, useTheme } from "@lumioui/core";
/**
* Divider — a hairline separator with an optional centered label.
* <Divider />
* <Divider label="or continue with" />
* <Divider label="or" seam /> lit seam: light gathers on the word
* <Divider label="or" seam lit /> brightened one step (e.g. while a path is pressed)
* <Divider orientation="vertical" />
*
* The plain rule is unchanged plumbing; the seam is opt-in.
*/
export interface DividerProps extends ViewProps {
/** Text rendered in the middle of the line. */
label?: string;
/** Line direction. Default "horizontal". */
orientation?: "horizontal" | "vertical";
className?: string;
/** Extra classes for the label text. */
labelClassName?: string;
/**
* Labeled rule only: draw it as a lit seam — each rule fades in from its
* outer end to full strength at the label. Default false.
*/
seam?: boolean;
/** Seam only: brighten the seam one step (crossfades over `timing.fast`). */
lit?: boolean;
}
/** One step brighter: the lit seam lifts from border ink toward muted ink at this alpha. */
const LIT_STEP = 0.55;
/** Dark scheme: the seam carries a 1px highlight beneath it, like a lit edge. */
const DARK_HIGHLIGHT = 0.06;
const useGradientId = () => React.useId().replace(/[^a-zA-Z0-9]/g, "");
/** One half of the seam — transparent at the outer end, full at the label. */
function SeamRule({ side, lit }: { side: "left" | "right"; lit: boolean }) {
const { colors, scheme } = useTheme();
const base = useGradientId();
const bright = useGradientId();
const glow = useSharedValue(lit ? 1 : 0);
React.useEffect(() => {
glow.value = lit
? withTiming(1, { ...timing.fast, easing: Easing.bezier(...ease.out) })
: withTiming(0, { ...timing.recede, easing: Easing.bezier(...ease.in) });
}, [lit, glow]);
const litStyle = useAnimatedStyle(() => ({ opacity: glow.value }));
// Left rule brightens left → right toward the label; right rule the reverse.
const left = side === "left";
const grad = (id: string, color: string, alpha: number) => (
<LinearGradient id={id} x1="0" y1="0" x2="1" y2="0">
<Stop offset={0} stopColor={color} stopOpacity={left ? 0 : alpha} />
<Stop offset={1} stopColor={color} stopOpacity={left ? alpha : 0} />
</LinearGradient>
);
const dark = scheme === "dark";
return (
<View
className="flex-1"
style={{ height: dark ? 2 : 1 }}
accessibilityElementsHidden
importantForAccessibility="no"
aria-hidden
>
<Svg width="100%" height={dark ? 2 : 1} style={{ position: "absolute" }}>
<Defs>
{grad(base, colors.border, 1)}
{dark ? grad(`${base}h`, "#FFFFFF", DARK_HIGHLIGHT) : null}
</Defs>
<Rect x="0" y="0" width="100%" height={1} fill={`url(#${base})`} />
{dark ? <Rect x="0" y="1" width="100%" height={1} fill={`url(#${base}h)`} /> : null}
</Svg>
<Animated.View style={[{ position: "absolute", left: 0, right: 0, top: 0, height: 1 }, litStyle]}>
<Svg width="100%" height={1}>
<Defs>{grad(bright, colors.mutedForeground, LIT_STEP)}</Defs>
<Rect x="0" y="0" width="100%" height={1} fill={`url(#${bright})`} />
</Svg>
</Animated.View>
</View>
);
}
export const Divider = forwardRef<React.ElementRef<typeof View>, DividerProps>(
function Divider(
{ label, orientation = "horizontal", className, labelClassName, seam = false, lit = false, ...props },
ref
) {
const horizontal = orientation === "horizontal";
if (!horizontal) {
// self-stretch only when the caller hasn't pinned a height — an
// explicit h-* class must win over alignSelf (style-order alone can't
// express that, so detect the class and drop the stretch).
const hasHeightClass = /(^|[\s:])h-/.test(className ?? "");
return (
<View
ref={ref}
className={cn("w-px bg-border", !hasHeightClass && "self-stretch", className)}
accessibilityElementsHidden
importantForAccessibility="no"
aria-hidden
{...props}
/>
);
}
if (label == null) {
return (
<View
ref={ref}
className={cn("h-px w-full bg-border", className)}
accessibilityElementsHidden
importantForAccessibility="no"
aria-hidden
{...props}
/>
);
}
return (
<View
ref={ref}
className={cn("w-full flex-row items-center gap-3", className)}
// The hairlines are hidden below, so the root carries the label as a
// single text element — AT announces "or continue with" once.
accessible
accessibilityRole="text"
accessibilityLabel={label}
{...props}
>
{seam ? (
<SeamRule side="left" lit={lit} />
) : (
<View
className="h-px flex-1 bg-border"
accessibilityElementsHidden
importantForAccessibility="no"
aria-hidden
/>
)}
<Text
className={cn("text-sm text-muted-foreground", labelClassName)}
// The root already announces the label — hide the inner Text so
// screen readers don't read it twice.
accessibilityElementsHidden
importantForAccessibility="no"
aria-hidden
>
{label}
</Text>
{seam ? (
<SeamRule side="right" lit={lit} />
) : (
<View
className="h-px flex-1 bg-border"
accessibilityElementsHidden
importantForAccessibility="no"
aria-hidden
/>
)}
</View>
);
}
);
Divider.displayName = "Divider"; import { Divider } from "@/components/ui/divider/divider";
export function Example() {
return (
<Divider />
);
} Installation
Install the dependencies
npx expo install react-native-reanimated react-native-svgCopy the source from the Code tab into your project
components/ui/divider/divider.tsxcomponents/ui/divider/index.tsUpdate the import paths to match your project setup.
Usage
import { Divider } from "@/components/ui/divider/divider"; <Divider /> Examples
The labeled rule where it actually lives: the "or" between email sign-in and the other ways in.
import * as React from "react";
import { View } from "react-native";
import { Divider } from "../divider";
import { Button } from "../../button/button";
import { Input } from "../../input/input";
import { Icon } from "../../icon/icon";
import { Text } from "../../text/text";
/** DividerLabeled — the labeled rule where it actually lives: the "or"
* between email sign-in and the other ways in. It is drawn as a lit seam,
* and brightens one step while either path below it is pressed. Continue
* is async so the form reacts. Neutral ink, like most auth screens. */
export function DividerLabeled() {
const [email, setEmail] = React.useState("");
const [sent, setSent] = React.useState(false);
const [pressing, setPressing] = React.useState(0);
const hold = { onPressIn: () => setPressing((n) => n + 1), onPressOut: () => setPressing((n) => Math.max(0, n - 1)) };
const valid = /.+@.+\..+/.test(email);
const send = async () => {
await new Promise((r) => setTimeout(r, 1100));
setSent(true);
};
return (
<View className="w-full gap-6 rounded-3xl bg-card p-5">
<View className="gap-1">
<Text className="text-2xl font-bold tracking-tight">Sign in to Lumio Notes</Text>
<Text variant="muted">
{sent ? `Check ${email} for a sign-in link.` : "We'll email you a magic link."}
</Text>
</View>
<View className="gap-3">
<Input
placeholder="[email protected]"
value={email}
onChangeText={(t) => {
setEmail(t);
setSent(false);
}}
autoCapitalize="none"
keyboardType="email-address"
accessibilityLabel="Email"
leftIcon={<Icon name="mail" size="sm" color="mutedForeground" />}
/>
<Button size="lg" className="w-full" disabled={!valid || sent} onPress={send}>
{sent ? "Link sent" : "Continue with email"}
</Button>
</View>
<Divider label="or" seam lit={pressing > 0} />
<View className="gap-3">
<Button size="lg" variant="secondary" className="w-full" {...hold}>
Continue with a passkey
</Button>
<Button size="lg" variant="secondary" className="w-full" {...hold}>
Continue with phone
</Button>
</View>
<Text className="text-center text-xs text-muted-foreground">
By continuing you agree to the Terms and Privacy Policy.
</Text>
</View>
);
} Vertical rules between the facts strip under an app listing, the app-store idiom.
import * as React from "react";
import { View } from "react-native";
import { Divider } from "../divider";
import { Button } from "../../button/button";
import { Icon } from "../../icon/icon";
import { Text } from "../../text/text";
const FACTS: { top: string; value: string; bottom: string }[] = [
{ top: "4.8K ratings", value: "4.7", bottom: "★★★★★" },
{ top: "Age", value: "4+", bottom: "Years old" },
{ top: "Chart", value: "#6", bottom: "Productivity" },
{ top: "Size", value: "38", bottom: "MB" },
];
/** DividerVertical — vertical rules between the facts strip under an app
* listing, the app-store idiom. Get flips to an async install. Neutral
* ink for the store CTA. */
export function DividerVertical() {
const [got, setGot] = React.useState(false);
const get = async () => {
await new Promise((r) => setTimeout(r, 1200));
setGot(true);
};
return (
<View className="w-full">
<View className="w-full gap-5 rounded-3xl bg-card p-5">
<View className="flex-row items-center gap-4">
<View className="h-20 w-20 items-center justify-center rounded-2xl bg-tint-orange">
<Icon name="calendar" size="lg" color="#FFFFFF" />
</View>
<View className="flex-1 gap-1">
<Text className="text-xl font-semibold">Cadence Planner</Text>
<Text variant="muted" numberOfLines={1}>Calendar and tasks in one week view</Text>
<View className="flex-row pt-1">
<Button size="sm" className="min-w-[80px]" onPress={got ? undefined : get}>
{got ? "Open" : "Get"}
</Button>
</View>
</View>
</View>
<View className="flex-row items-center border-t border-border pt-4">
{FACTS.map((f, i) => (
<React.Fragment key={f.top}>
{i > 0 ? <Divider orientation="vertical" className="h-10" /> : null}
<View className="flex-1 items-center gap-1">
<Text className="text-xs text-muted-foreground">{f.top}</Text>
<Text className="text-xl font-semibold tabular-nums text-muted-foreground">{f.value}</Text>
<Text className="text-xs text-muted-foreground" numberOfLines={1}>{f.bottom}</Text>
</View>
</React.Fragment>
))}
</View>
</View>
</View>
);
} API reference
label string Text rendered in the middle of the line.
—orientation "horizontal" | "vertical" Line direction. Default "horizontal".
"horizontal" className string — labelClassName string Extra classes for the label text.
—seam boolean Labeled rule only: draw it as a lit seam — each rule fades in from its outer end to full strength at the label. Default false.
false lit boolean Seam only: brighten the seam one step (crossfades over timing.fast).
false