Skip to main content

API reference

Every export from patine-ui, grouped. Each name links to its full documentation.

Compound components take a props-first shorthand on their root: Dialog, Modal and Drawer (trigger, title, description, actions), AlertDialog (title, description, confirmLabel, destructive, onConfirm…), Popover and Collapsible (trigger), Tabs and Accordion (items), Card (title, description, footer), Alert (title, description) and RadioGroup (options). Leave them out to compose the parts.

Components​

ExportDescription
Text, HeadingText from the theme's type scale; headings with a level
Stack, HStack, VStackColumns and rows with gap and padding from the spacing scale
SeparatorA horizontal or vertical divider
Box, Spacer, Center, Container, Grid, AspectRatioLayout: a View with theme props, flexible space, centering, a max-width column, responsive columns, a fixed ratio
VisuallyHidden, Slot, Portal, PortalHostScreen-reader-only text, Radix-style prop merging for asChild, and drawing over the app
ButtonSix variants, four sizes, loading state, start and end icons
ButtonGroupRelated buttons joined into one bar, across or down
LinkA text link: a real anchor on the web, opens the browser on native
FabA floating action button, extended with a label, placed in a corner
CopyButtonCopies a value and shows a check; browser clipboard or yours
ToggleButton, ToggleGroup, ToggleGroupItemButtons that stay pressed; a row of them with one or many pressed
CheckboxChecked, unchecked or mixed, with a label and description
CheckboxGroupAny number of options from a list, with a select-all box
TextFieldA labelled text input: helper text, errors, clear button, password toggle, counter, prefix and suffix
TextAreaA multi-line TextField that grows with its text
SearchFieldA search bar in the platform's style: clear button, Search key, iOS Cancel
NumberField, StepperA number input with − and +, and a − / + stepper; min, max, step, hold to repeat
SwitchA toggle with a label and description
RadioGroup, RadioGroupItemOne choice from a few, arrow keys on the web
Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooterA surface for related content and actions; with onPress it lifts on hover
Accordion, AccordionItem, AccordionTrigger, AccordionContentSections that open and close, one or many at a time
Collapsible, CollapsibleTrigger, CollapsibleContentOne section that shows and hides, with any icon, position and turn
DisclosureIconThe turning open/closed icon on its own
ImageA picture in a frame that keeps its size while loading: placeholder, fade in, fallback, alt text. Shares React Native's Image name; rename one on import if you need both
AvatarA picture with an initials fallback
AvatarGroupOverlapping avatars with a +N for the rest
BadgeA small label for status and counts
Alert, AlertTitle, AlertDescriptionA banner, announced to screen readers when it's an error
SkeletonA pulsing placeholder while content loads
Progress, SpinnerA progress bar, determinate or sweeping, and the platform's activity indicator
EmptyStateAn icon, heading, next step and action for an empty screen
List, ListItemGrouped rows for settings and menus: values, switches, chevrons
Table, sortRows, compareValuesRows and columns: custom cells, sortable headers, pressable and striped rows, sideways scroll
DescriptionListTerms and their details, side by side or stacked
StatA KPI tile: label, figure, green or red change with an arrow
KbdKeyboard keys and shortcuts, read aloud as words
SwipeableRowSwipe a row for leading and trailing actions; full swipe; one open row at a time
SortableList, SortableHandle, moveItemDrag to reorder: long press or a handle, auto-scroll, keyboard and screen-reader moves
Carousel, Pager, PageIndicatorSwipe between pages or peeking slides: dots, arrows on the web, loop, autoplay, arrow keys
QRCode, createQRCodeA scannable QR code drawn with views: UTF-8, levels L to H, versions 1–40, a logo
MessageBubble, ChatComposerChat bubbles and a composer that grows and sends on Enter
TypingIndicatorThree dots in an incoming bubble while a reply is written, announced to screen readers
SuggestionChipsQuick replies in a row that scrolls sideways
Toaster, toastToasts from anywhere: success, error, loading and promise toasts, actions, swipe to dismiss, announced to screen readers
HeaderA screen's top bar: back button, title, actions, large title
Tabs, TabsList, TabsTrigger, TabsContentPanels shown one at a time, with a sliding indicator and arrow keys on the web
BottomTabBar, NavigationRailAn app's main destinations along the bottom or down the side: badges, Material's pill indicator
BreadcrumbsA trail of links back up the hierarchy, long paths folded
Pagination, getPageItemsPrevious, page numbers with ellipses, Next; or a compact "Page 3 of 10"
StepsA stepper for checkout and onboarding: numbered steps across or down, or a progress bar
WheelPicker<T>Single scrolling wheel
MultiWheelPickerSeveral wheels in one band
TimePickerHour / minute / second / AM-PM wheels
TimeRangePickerA start and an end time: opening hours, shifts, overnight ranges
DurationPickerA length of time in seconds: wheels, number boxes or columns
DatePickerCalendar (display="calendar") or wheel (display="wheel")
CalendarMonth calendar: single / range / multiple / ranges
DateWheelPickerDay / month / year wheels
MonthPickerMonth and year: wheels (iOS) or a grid of months (Material, web)
WeekStripOne week of days in a row, swipe or arrows to page
ExpandableCalendarA week that opens into its month with a drag down or its handle
DateTimePickerDay + time wheels (display="wheel") or calendar + time (display="calendar")
Select<T>Field + searchable sheet
SelectList<T>Inline searchable list
CountryPickerCountry field: flags, dialing codes, localized names
LanguagePickerLanguage field: each language in itself, its name in the user's language below
PhoneFieldPhone number input: country code button, formats as you type, E.164 value
TimeZonePickerTime zone field: GMT offsets, sorted by offset, the device's zone on top
SegmentedControl<T>A few choices on a track with a sliding thumb
ChipGroup<T>Choice chips that scroll sideways
EmojiPickerEmoji keyboard
ColorPickeriOS's tabs, Google's swatch circles or the browser's spectrum; hex with opacity
SlideriOS's knob, Material 3's handle or a range input; one value or a range
InputOTPOne-time code in a box per character, with SMS autofill and paste
RatingStars to tap or drag, whole or half steps, or a read-only score
SignaturePad, signatureToSvg, signatureToPath, isSignatureEmptySign with a finger, pen or mouse; export the strokes as SVG
BottomSheetAnimated sheet
Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogCloseA modal window built from parts
AlertDialog, AlertDialogAction, AlertDialogCancelConfirm or cancel; the backdrop doesn't close it
Modal, ModalTrigger, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalBody, ModalFooter, ModalCloseRich content: centered with sizes, full screen on a phone, nests
Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, DrawerCloseA side panel that slides in from either edge
Popover, PopoverTrigger, PopoverContent, PopoverCloseA panel beside its trigger: four sides, flips and stays on screen, optional arrow, or a bottom sheet
Tooltip, TooltipProviderA short label on hover or keyboard focus (web) or long press (touch)
ImageViewerA full-screen photo lightbox: swipe, pinch and double-tap zoom, swipe down to close
DropdownMenuA dropdown or long-press context menu of actions by its trigger, or an action sheet
ActionSheetA list of actions in a sheet: iOS cards or Material rows, destructive, disabled and selected actions

Sheets​

ExportDescription
PickerSheetBottomSheet with Cancel / Done
DatePickerSheetCalendar or date wheel in a sheet
TimePickerSheetTimePicker in a sheet
TimeRangePickerSheetTimeRangePicker in a sheet
DateTimePickerSheetDateTimePicker in a sheet
DurationPickerSheetDurationPicker in a sheet
MonthPickerSheetMonthPicker in a sheet
WheelPickerSheet<T>WheelPicker in a sheet
EmojiPickerSheetEmojiPicker in a sheet
ColorPickerSheetColorPicker in a sheet
useDraft(value, open, { resetKey?, commit? })Draft state that resets on open; commits each change inline
useActionSheet(){ show, hide, actionSheet }: show an ActionSheet from a call, no provider

Fields​

ExportDescription
PickerFieldLabelled field that opens the sheet its child renders
DatePickerFieldField + DatePickerSheet; shows the date, range or dates
TimePickerFieldField + TimePickerSheet; shows the time
TimeRangePickerFieldField + TimeRangePickerSheet; shows the range, such as 9:00 AM – 5:00 PM
DateTimePickerFieldField + DateTimePickerSheet; shows the date and time
DurationPickerFieldField + DurationPickerSheet; shows 1 h 30 min
MonthPickerFieldField + MonthPickerSheet; shows October 2026
WheelPickerField<T>Field + WheelPickerSheet; shows the item's label
EmojiPickerFieldField + EmojiPickerSheet; shows value
ColorPickerFieldField + ColorPickerSheet; shows a swatch and the hex code

Pro: charts​

From @patine-ui/pro, drawn with react-native-svg.

ExportDescription
LineChart, AreaChartTrends over time; monotone or step curves, stacked and 100% areas, gradient fills, dashed forecasts, date axes
BarChartGrouped, stacked, 100% or horizontal bars; goal marks, value labels
ComboChartBars with lines or areas, and a second value axis
PieChart, DonutChartParts of a whole; half donuts, outside labels, the total in the donut's hole
RadialChartConcentric rings toward goals, like activity rings
GaugeChartOne value on an arc with colored ranges, a target and an optional needle
HeatmapChartDays as a contribution calendar
ScatterChartPoints or bubbles by group, with a trend line
FunnelChartConversion through stages
SankeyChart, proportionalFlows, collectFlows, sankeyLayoutFlows from one side to the other, each band as wide as what it carries
RadarChartSeveral measures on spokes, an outline per series
SparklineA small line, area or bar trend with no axes
StatusTracker, DEFAULT_STATUSESA row of bars coloured by status: uptime per period
chartPalette, contrastRatio, ensureContrast, valueFormats, CHART_DESIGN, CURVE, GRID, VALUE_FORMATThe series palette at 3:1 contrast, value format presets, and each design's chart look
Types: ChartBaseProps, CartesianProps, SeriesConfig, ReferenceLine, ReferenceBand, ChartSelection, Readout, ValueFormat, ChartGrid, and each chart's …Props

Pro: AI chat​

From @patine-ui/pro.

ExportDescription
ChatA complete chat: streaming Markdown replies, reasoning, a live plan, tool calls, cited sources, follow-ups, copy, regenerate, feedback, edit, stop, retry, older history, quick replies, attachments
AIChatScreenA whole assistant: history, prompt cards, a model picker and the chat; runs demoAssistant without a backend
MessengerThread, ConversationList, MessengerScreenChat between people: an inbox with presence, drafts and unread counts; a thread with replies, reactions, receipts, albums, files, links, polls, voice recording, edit, delete, forward, pins, search and select
MessengerComposer, ChatDetailsThe message box alone (+ menu, emoji, @mentions, hold to record), and a conversation's details: people, starred messages, media, files and links
ChannelThreadA Slack-style channel: plain rows, reaction chips, threads with a reply count, hover toolbar
toggleReaction, castVote, parseRichText, mentionIndex, searchMessages, sharedContent, buildThreadRows, previewLineThe messenger's pure logic, for your backend stand-in or tests
NotificationCenter, NotificationInboxA bell with a live unread count and an inbox: tabs with Archived, a kind filter, days, swipe or hover to read, snooze and archive, inline actions, a New pill, settings
CommandPalette, CommandMenu⌘K search: fuzzy matches lit, Recent, pages for nested commands, shortcuts, async results; a sheet on phones. fuzzyMatch, rankCommands, useCommandMenu
Navbar, useNavbarScrollA marketing site's bar: mega menus with a sliding indicator, frosted and sticky on scroll, a full-screen animated menu on phones
useChat({ adapter, initialMessages?, loadOlder? })Connects Chat to any backend; spread the result onto it
MarkdownMarkdown as native text, safe while it streams
Reasoning, ToolCall, ChatSuggestions, AttachmentListThe chat's parts, for your own layout
streamText, streamServerEvents, simulateStreamRead a fetch body or server-sent events as it downloads; fake a stream for demos
parseMarkdown, parseInlineThe Markdown parser behind Markdown

Pro: app layout​

From @patine-ui/pro.

ExportDescription
AppShellAn app's frame: a tab bar with More or a swipeable drawer on phones, a navigation rail with a full drawer from 640 points, a collapsible, resizable sidebar with a workspace switcher, favorites, counts, dots and tags from 1024; ⌘K palette and G-then-letter shortcuts
UsageCard, WorkspaceSwitcherA plan-usage meter with Upgrade for the sidebar's footer, and the workspace switcher
PageA screen's frame: the platform's top bar on phones, a title with labelled actions wider; a footer pinned on phones
Panel, StatCard, Grid, Num, StatusBadgeA titled card, a key number with its change, equal columns, tabular figures, a status in color and words
DataTable, useTableSortable columns, bulk selection and row presses on wide screens; cards on phones
QueryStateContent, a loading skeleton, an error with Try again, or an empty state
CommandPaletteSearch and jump anywhere, with arrow keys and Enter
AuthShellSign-in screens alone on phones, beside a brand panel on desktop
useLayout(){ width, breakpoint, wide, desktop, insets } of the space a screen draws in
useStackA small in-memory navigation stack
Icon, IconButton, PressyLine icons by name, a 44-point labelled icon button, a pressable with hover and focus states
formatMoney, formatAgo, formatDay, formatDelta, formatCompact, dayHeading, matches, fitColumnsFormatting and search helpers

Pro: apps​

From @patine-ui/pro. Each app runs on sample data as one component, and each of its screens is exported to wire to your router and API.

ExportScreens
CryptoAppPortfolioScreen, WelcomeScreen, MarketsScreen, AssetScreen, SwapScreen, ReceiveScreen, ActivityScreen, WalletSettingsScreen; portfolioTotals, swapQuote, applySwap, formatCoin, formatUsd
StoreAppDiscoverScreen, BrowseScreen, ProductScreen, BagScreen, StoreCheckoutScreen, OrderScreen, SavedScreen, StoreAccountScreen; addToBag, bagTotals, filterProducts
BudgetAppBudgetOverviewScreen, BudgetActivityScreen, BudgetLimitsScreen, InsightsScreen, GoalsScreen, BillsScreen, AddExpenseScreen, BudgetSettingsScreen; monthSummary, budgetsFor, goalStatus, activityByDay
FitnessAppTodayScreen, SetupScreen, TrainScreen, WorkoutScreen, SessionScreen, FitnessProgressScreen, ClassesScreen, FitnessProfileScreen; heartZone, sessionAt, clock
FoodAppFoodHomeScreen, RestaurantScreen, DishScreen, BasketScreen, TrackingScreen, CourierChatScreen, RateScreen, FoodOrdersScreen; basketTotals, unitPrice
TravelAppExploreScreen, DestinationScreen, FlightsScreen, BookFlightScreen, BoardingPassScreen, TripScreen, TravelAssistantScreen, ExpensesScreen; filterFlights, settleUp
SaasAppAnalyticsOverviewScreen, FunnelsScreen, AudienceScreen, ReportsScreen, CopilotScreen, RoadmapScreen, SprintBoardScreen, StatusScreen, SaasBillingScreen; biggestDrop, filterReports

Sign-up and recovery screens, to put in AuthShell beside SignInScreen: SignUpScreen, VerifyScreen, ForgotPasswordScreen, NotFoundScreen, OfflineScreen; PasswordMeter, passwordStrength, validateSignUp, maskEmail, useCountdown.

Pro: icons​

From @patine-ui/pro. Each icon is also its own module: @patine-ui/pro/icons/<kebab-name>.

ExportDescription
IconA Patine icon by name: name, variant (outline, solid, duotone, color), size, color, secondaryColor, strokeWidth, accessibilityLabel, mirror
GlyphDraws one icon's data (icon={iconBell}), tree-shakeable
iconBell, iconCart, …669 icons as plain data: { name, tone, rtl?, paths }
ICONS, ICON_METAEvery icon by name; each icon's category and search words
ICON_SIZE, ICON_TONE, ICON_VARIANT, ROLENamed sizes, the color variant's palettes, the variants, path role flags
IconName, IconProps, GlyphProps, IconGlyph, IconVariant, IconCategory, IconTone, IconPathTypes
BrandIconA brand or social logo by name: name, variant (color, mono, tile), size, color, shape, accessibilityLabel. Each logo is also @patine-ui/pro/brands/<name>
BrandGlyphDraws one logo's data (brand={brandGithub}), tree-shakeable
brandGithub, brandStripe, …147 logos as plain data: { name, title, hex, path }
BRANDS, BRAND_METAEvery logo by name; each logo's category
BRAND_SIZE, BRAND_VARIANT, BRAND_SHAPENamed sizes, the variants, the tile shapes
BrandName, BrandIconProps, BrandGlyphProps, BrandGlyphData, BrandVariant, BrandShape, BrandCategoryTypes

Pro: tree view​

From @patine-ui/pro.

ExportDescription
TreeViewA virtualized tree: expand and collapse, single selection or checkboxes with mixed parents, lazy children, WAI-ARIA keys
DashboardGrid, WidgetA dashboard people arrange: widgets on a 12/6/1-column grid to drag, resize, remove with Undo and add from a gallery, layouts per breakpoint, arrow keys on the web and long-press reorder on phones; Widget has a period switch, a menu, full screen, and loading, empty and error states
NumberTicker, useDashboardItem, addItem, moveItem, resizeItem, removeItem, deriveLayoutA KPI that counts to its value, a widget's place in its grid, and the grid's layout logic
AnalyticsDashboardScreenA web analytics dashboard: ticking KPIs, revenue vs the previous period, live visitors, funnel, pages, countries, retention; date range, compare, filters and Edit dashboard
DataGridVirtualized grid (10k+ rows), server and infinite modes, typed columns, multi-sort, filter builder and quick filters, grouping with totals, tree data, master-detail, column drag/pin/fit, spreadsheet keys and copy, editing with validation and undo, saved views, row actions, CSV export; cards and a filter sheet on phones
sortGrid, filterGrid, applyRule, aggregateThe DataGrid's own sort, filter and totals, for a server or a mock API
MapView, MapMarker, MapRouteA tile map without native modules: drag, pinch, wheel, markers, routes; clusterPoints, fitBounds
DispatchScreenA live fleet on a map: KPIs, van and order lists, stop timelines, assigning and reassigning with undo
StoreLocatorScreenA store finder: search, open-now and service filters, nearest-first list in sync with clustered pins, hours, call and directions
openStatus, findStores, directionsUrl, STORE_SERVICESThe store locator's open-now wording, search and sort, and maps-app links
CourierTrackingScreenLive delivery tracking: the courier on the route, countdown, steps, call and chat, rating with a tip
tripState, TRIP_STEPS, DEMO_TRIPWhere a delivery is at a given second, and its steps
TeamChatScreenA Slack-style team chat: channels and DMs, threads in a side panel, reactions, pins and a huddle bar
flattenVisible, getCheckedStates, toggleCheckedThe tree's pure logic: visible rows, checkbox states, cascading a check
TREE_DESIGN, TREE_SELECTIONEach design's rows; the selection modes

Pro: media​

From @patine-ui/pro.

ExportDescription
DropzoneDrop, browse or paste files; accept, maxSize, maxFiles checks with the reasons shown
useUploadThe upload queue: your upload(file, { onProgress, signal }) adapter, a concurrency limit, progress, speed, time left, pause, resume, retry, cancel, reorder
FileUploadListThe queue's files: thumbnails or type tiles, progress bars, speed and time left, actions per file, a summary
AvatarUploaderA profile photo: pick, crop in a circle, upload with a progress ring, retry
ImageGalleryUploaderA grid of photos: add, upload over each thumbnail, remove, drag to reorder, a cover
xhrUpload, mockUpload, browserPickFiles, fromWebFilesA ready adapter for your endpoint, a pretend one for demos, the web's picker
validateFiles, describeRules, matchesAccept, fileKind, formatBytes, formatDurationThe uploader's pure logic
ImageCropperPan, pinch, wheel and double-tap zoom, aspects, a circle mask, rotate, flip, free-crop corners; the crop in source pixels
cropToDataUrlCuts a crop out with a canvas on the web
toSourceRect, fromSourceRect, fitBox, coverScale, aspectLabelThe cropper's math
VideoPlayerVideo controls: poster, timeline with buffered range and hover time, volume, speed, captions, full screen, picture in picture, keyboard; renderVideo for expo-video
AudioPlayer, MiniPlayer, TrackListA track card with a waveform scrubber, skip and speed; a mini player bar; an episode list
useAudioPlayerOne audio player to share; HTMLAudioElement on the web, an adapter (expo-audio) on native
formatMediaTime, resamplePeaksThe players' pure logic: "1:02:05", a waveform fitted to its bars

Pro: rich text editor​

From @patine-ui/pro.

ExportDescription
RichTextEditorA block editor: / commands, @ mentions, Markdown shortcuts, a floating or docked toolbar, links, drag to reorder, undo, read-only rendering
CommentComposerA Linear-style comment box: toolbar, mentions, attachments, Cmd+Enter to send
toMarkdown, fromMarkdownThe document to and from GitHub-flavored Markdown
countText, isDocEmptyWords and characters; whether nothing has been written
BLOCK_COMMANDS, BLOCK_TYPE, MARK_TYPE, CALLOUT_TONE, TOOLBAR_ITEM, EDITOR_DESIGNThe / menu's entries, block and mark types, callout tones, toolbar buttons, each design's look
RichTextDoc, RichTextBlock, Mark, MentionItem, BlockCommand, RichTextEditorProps, CommentComposerProps, EditorLabelsTypes

Pro: blocks​

From @patine-ui/pro. Each takes design, theme, density, animate, labels and, for data, loading, error, onRetry and an empty state. See the overview.

ExportDescription
StatsRowKPI tiles with the change in words, trends, and selectable tiles that switch a chart
TimelineEvents along a line with status markers, day headings, Show more, across or down
ActivityFeedWho did what, by day, with filters, unread dots and Load more
OrderTrackerAn order's arrival day, status, step bar, tracking number and carrier scans
Wizard, WizardStepA task in steps: indicators, sync and async validation, optional steps, async finish
PricingTablePlan cards, a comparison table or a paywall list, with a billing toggle and savings
ProductCardA product with sale and stock badges, wishlist, swatches and Add to cart
ReviewListReviews with their summary, star filter, sorting, replies and Helpful votes
KanbanColumns of cards to drag, with WIP limits, a Move to menu and keyboard moves
AgendaThe days ahead under a week strip, with a now line
EventCalendarEvents by month, week or day, overlaps side by side
GanttTasks on a timeline with dependencies, dragged to move and stretch
AIUsageMeterAI tokens or credits against a limit, by model, with a forecast and Upgrade
AgentActivityAn AI agent's steps with spinners, times, details, approvals, Stop and Try again
ApprovalCardAn assistant's change with before → after rows, held on Approve or Cancel, then Done, Cancelled or what failed
moveCard, groupCards, placeDay, toTimed, weekDays, agendaDays, taskDates, shiftDates, summarize, sortReviews, planPrice, bestSaving, statDelta, formatRatio, discountPercent, reachedIndex, arrivalLine, resolveStatuses, usageRatio, usageLevel, runStatus, formatMs, filterActivities, sortByTime, activitySentence, groupByDay, dayLabel, formatRelative, formatTime, toDateThe blocks' pure logic, for your own screens and servers
…_DESIGN, DENSITY, BLOCK_LABELS and each block's …Props, item and label types
ExportDescription
PatineProviderApp-wide theme, colour scheme, platform and design
useTheme(override?)Resolved active theme
useComponentTheme(theme, design) / useDesignOverride(theme, design)For your own components: the theme to draw with, and the override with design folded in, 'native' resolved to the platform's design
usePlatform()The platform components behave as on: PatineProvider's platform, or Platform.OS (type PlatformOS). For your own components that open a sheet on phones and a dropdown on the web
createTheme(overrides, base?)Full theme from overrides
mergeTheme(base, override?)Deep merge
lightTheme / darkThemeBuilt-in themes
DESIGN / DESIGN_TOKENS / resolveDesign(preference, platform)The iOS, Material and web designs
DESIGN_SHADOWS / SHADOW_LEVEL / stepShadow(level, steps)Each design's shadow scale, its levels, and a step up or down it
useReducedMotion() / useBlink(active, restartKey?) / usePulse(options?)Whether the OS asks to reduce motion; a caret-style blink and a loading pulse that stay still when it does
textStyle(theme, size, weight?, font?) / fontFace(theme, weight?, font?)Text style from tokens; the family and weight for a font role
TEXT_SIZE / TEXT_WEIGHT / FONT_ROLE / DENSITY / TABULARThe type scale's steps, weights and font roles, the density values, and the tabular-figures style (types TextSize, TextWeight, FontRole, FontFaces, Density)
useAnimatedTo(target, { duration, native, instant })An Animated.Value that animates to target whenever it changes; jumps there with instant or when the OS reduces motion
useAnimatedToggle(on, duration) / usePop(on) / usePresence(options) / useCollapse(open, duration) / useSlideIn(duration) / useAnimatedValue(initial) / timing / spring / DURATION / EASE_OUTThe library's named motion, for Pro and your own components: a 0 → 1 toggle, a mark popping in, mount and unmount with an exit, a height folding, a page sliding in, and the eased timing and spring behind them; all still when the OS reduces motion
Scroll / VirtualList / Input / Span / PressableThe primitives the components draw with, from patine-ui/core: a ScrollView and a FlatList whose taps work while the keyboard is up and with no scrollbar track on the web, a TextInput in the theme's type and colours with a capped font scale, a run of text that inherits its parent Text's style (rich text), and a pressable surface for what isn't a control (a backdrop, a drag area). For your own components, in place of React Native's
AnimatedView / AnimatedText / AnimatedImage / AnimatedScrollView / animatedAdd / animatedMultiply / animatedSubtract / animatedEvent / createAnimatedValue(n) / createAnimatedComponent(C)Views and values to animate without importing Animated: values made outside a component, and any other view made animatable (an SVG shape)
ThemeScopeHands a component's theme or design down to everything inside it, as PatineProvider does
useFocusVisible() / focusRing(color)Focus state for a ring on keyboard focus only (onFocus, onBlur, focusVisible), and the ring's style
IS_WEBWhether a DOM exists, for DOM-only features; behaviour follows usePlatform()
useControllableState(value, defaultValue, onValueChange?)Controlled when value is set, else its own state; the setter calls onValueChange

Date utilities​

startOfDay · startOfMonth · daysInMonth · addDays · addMonths · isSameDay · isSameMonth · compareDay · isBetweenDays · isOutOfRange · clampDate · toDateKey · buildMonthGrid · getMonthNames · getWeekdayNames · formatMonthYear · formatDate · uses12HourClock · getFirstDayOfWeek · getDayPeriods

getRangePresets: Today, Yesterday, Last 7 days, Last 30 days, This month and Last month as presets for a range calendar.

CALENDAR_MODE: the calendar selection modes as constants (single, range, multiple, ranges), e.g. mode={CALENDAR_MODE.ranges}.

Emoji utilities​

getAllEmojis · searchEmojis · findEmoji · withSkinTone · EMOJI_CATEGORIES · DEFAULT_CATEGORY_LABELS · DEFAULT_CATEGORY_ICONS

Color utilities​

normalizeHex · hexToHsv · hsvToHex · withAlpha · DEFAULT_COLORS

COLOR_DISPLAY: the ColorPicker layouts as constants (tabs, swatches, spectrum), e.g. display={COLOR_DISPLAY.swatches}.

Country utilities​

getCountry · getAllCountries · getCountryFlag

Language utilities​

getLanguage · getAllLanguages · getLanguageName · isRtlLanguage

Phone utilities​

parsePhone · formatNationalNumber · isValidPhone · toE164

Time zone utilities​

getDeviceTimeZone · getTimeZoneOffset · formatGmtOffset · getTimeZoneName · normalizeTimeZone · getTimeZone · getAllTimeZones

Time range utilities​

formatTimeRange(range, { format?, locale?, showSeconds? }): '9:00 AM – 5:00 PM', or '22:00 – 07:00 +1' overnight · getTimeRangeSeconds(range): the length, into the next day for an overnight range

Duration utilities​

formatDuration(seconds, { showHours?, labels? }): 5400 → '1 h 30 min'

Select utilities​

ExportDescription
defaultFilter(option, query)The default search: case-, accent- and niqqud-insensitive; every word must match label, description or keywords

Types​

See TypeScript for the full list. The most used:

interface DateRange { start: Date | null; end: Date | null }

interface DateRangePreset { label: string; start: Date; end: Date }

interface TimeRange { start: Date; end: Date } // the end on the start's day, or the next day overnight

type RangePresetsListProps = Omit<ChoiceProps<DateRange>, 'items' | 'value' | 'onValueChange' | 'isEqual'>

interface MarkedDate { dots?: string[]; disabled?: boolean; label?: string; textColor?: string }

interface SelectOption<T> {
label: string; value: T; description?: string; disabled?: boolean;
icon?: React.ReactNode; group?: string; keywords?: string[];
}

interface WheelItem<T> { label: string; value: T; disabled?: boolean; key?: string }

/** Shorthand items. */
interface DialogAction extends Omit<ButtonProps, 'children'> { label: string } // Dialog, Modal and Drawer `actions`
interface TabsItem { value: string; label: ReactNode; content: ReactNode; icon?: ReactNode; disabled?: boolean }
interface AccordionListItem { title: ReactNode; content: ReactNode; value?: string; disabled?: boolean }
type RadioGroupOption = Pick<RadioGroupItemProps, 'value' | 'label' | 'description' | 'disabled'>;

type SkinTone = 0 | 1 | 2 | 3 | 4 | 5;

/** Every sheet's `presentation`. */
type SheetPresentation = 'auto' | 'bottomSheet' | 'modal';

/** A field's `presentation`: a sheet presentation, a dropdown under the field, or inline: expanded in place under it. Its `auto` (the default) is a dropdown on the web. */
type FieldPresentation = SheetPresentation | 'dropdown' | 'inline';

/** Select's `presentation`; its `auto` is a dropdown on the web. */
type SelectPresentation = FieldPresentation;

/** The field slots every `*PickerField` and `PickerField` takes in `styles`. */
type PickerFieldSlot = 'label' | 'trigger' | 'triggerText' | 'placeholder' | 'chevron' | 'clear' | 'helperText';

/** A message shown under the field, or `true` to mark it invalid without one. */
type FieldError = string | boolean;

/** Validation shown on every field, Select, PhoneField and InputOTP (`error` and `helperText` only). Set from your form; the field doesn't check the value. */
interface FieldStatusProps {
error?: FieldError; // invalid: red border and label, the message under the field when it's a string
helperText?: string; // under the field, replaced by the error message
required?: boolean; // asterisk on the label, "required" for screen readers
}

type SlotStyles<K extends string> = Partial<Record<K, StyleProp<TextStyle>>>;

interface ThemableProps { theme?: DeepPartial<Theme>; design?: DesignPreference } // 'brand' | 'ios' | 'material' | 'web' | 'native'

/** Sheets you control: BottomSheet, ActionSheet and every *PickerSheet. */
interface OpenStateProps { open?: boolean; onOpenChange?: (open: boolean) => void }

/** Overlays that open from their trigger: Select, DropdownMenu and every field. */
interface TriggeredOpenProps { open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void }

/** Checkbox, CheckboxGroup and Switch: which side of the label the control sits on. */
type ControlPosition = 'start' | 'end';

Default strings​

WherePropDefault
SheetsconfirmLabel / cancelLabelDone (iOS, web) · OK (Material) / Cancel
Select, fieldsplaceholderSelect…
SelectListsearchPlaceholder / emptyText / loadingText / searchPromptSearch / No results / Loading… / Type to search
Select, SelectListcreateLabelAdd "…"
ActionSheetcancelLabelCancel
CountryPickerplaceholder / searchPlaceholder / preferredLabel / allCountriesLabelSelect a country / Search countries / Suggested / All countries
LanguagePickerplaceholder / searchPlaceholder / preferredLabel / allLanguagesLabelSelect a language / Search languages / Suggested / All languages
PhoneFieldlabel / countrySheetTitlenone (read as Phone number) / Country code
TimeZonePickerplaceholder / searchPlaceholder / preferredLabel / allTimeZonesLabelSelect a time zone / Search time zones / Your time zone / All time zones
EmojiPickersearchPlaceholder / emptyTextSearch emoji / No emoji found
TimePickerdayPeriodLabelsfrom locale (AM / PM)
TimeRangePickerstartLabel / endLabelStart / End
InputOTPaccessibilityLabelVerification code
RatingaccessibilityLabel / formatValueRating / 3 of 5
ColorPickerlabelsGrid, Spectrum, Sliders, Hue, Opacity, Red, Green, Blue, Hex, Copy, Copied, Custom colour…
DurationPickerlabels{ hours: 'h', minutes: 'min', seconds: 's' }
getRangePresets()labelToday, Yesterday, Last 7 days, Last 30 days, This month, Last month
Carousel, PagerlabelsPrevious slide / Next slide / Slide {page} of {count}
SortableListlabelsMove up / Move down / Moved to position {position} of {count}
ImageViewerlabelsClose / Previous image / Next image / Image {page} of {count}
SignaturePadlabelsSign here / Clear / Signature / Signed / Empty
StepslabelsStep {page} of {count} / completed / error
QRCodeaccessibilityLabelQR code

Default values at a glance​

PropDefaultComponents
itemHeight40wheels
visibleItems5wheels
variant'3d'wheels
rotation / fadeTo20 / 0.3WheelPicker
loopfalse WheelPicker · true TimePicker, DurationPicker, DateWheelPicker, MonthPickerwheels
keyboardInputtrueWheelPicker
minuteInterval / secondInterval1TimePicker, DurationPicker
format'auto'TimePicker
display'wheel' iOS · 'dial' Material · 'list' webTimePicker
display'wheel' iOS · 'input' Material · 'list' webDurationPicker
display'wheel' iOS · 'grid' Material, webMonthPicker
display'tabs' iOS · 'swatches' Material · 'spectrum' webColorPicker
min / max / step0 / 100 / 1Slider
valueLabel'drag' Material · 'never' iOS, webSlider
length / inputMode6 / 'numeric'InputOTP
max / step / size5 / 1 / 32Rating
display / timeDisplay'wheel' / 'wheel' iOS · 'calendar' / 'input' Material · 'calendar' / 'list' webDateTimePicker
timePosition'beside' web · 'below' otherDateTimePicker
dayHeight44Calendar
fixedWeeks / showOutsideDaystrueCalendar
enableSwipe / enableQuickJumptrueCalendar
weekdayFormat'short' · 'narrow' MaterialCalendar
monthFormat'long'DateWheelPicker, MonthPicker
searchableoptions.length > 8 · true emojiSelect, Emoji
closeOnSelecttrueSelect, EmojiPickerSheet
chipstrueSelect
clearable / disabledfalseSelect, fields
requiredfalseSelect, fields, PhoneField
columns / height8 / 380 (420 in sheet)EmojiPicker
maxRecent24EmojiPicker
maxHeightRatio0.9BottomSheet
bottomInset24 iOS · 12 otherBottomSheet