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
| Export | Description |
|---|---|
Text, Heading | Text from the theme's type scale; headings with a level |
Stack, HStack, VStack | Columns and rows with gap and padding from the spacing scale |
Separator | A horizontal or vertical divider |
Box, Spacer, Center, Container, Grid, AspectRatio | Layout: a View with theme props, flexible space, centering, a max-width column, responsive columns, a fixed ratio |
VisuallyHidden, Slot, Portal, PortalHost | Screen-reader-only text, Radix-style prop merging for asChild, and drawing over the app |
Button | Six variants, four sizes, loading state, start and end icons |
ButtonGroup | Related buttons joined into one bar, across or down |
Link | A text link: a real anchor on the web, opens the browser on native |
Fab | A floating action button, extended with a label, placed in a corner |
CopyButton | Copies a value and shows a check; browser clipboard or yours |
ToggleButton, ToggleGroup, ToggleGroupItem | Buttons that stay pressed; a row of them with one or many pressed |
Checkbox | Checked, unchecked or mixed, with a label and description |
CheckboxGroup | Any number of options from a list, with a select-all box |
TextField | A labelled text input: helper text, errors, clear button, password toggle, counter, prefix and suffix |
TextArea | A multi-line TextField that grows with its text |
SearchField | A search bar in the platform's style: clear button, Search key, iOS Cancel |
NumberField, Stepper | A number input with − and +, and a − / + stepper; min, max, step, hold to repeat |
Switch | A toggle with a label and description |
RadioGroup, RadioGroupItem | One choice from a few, arrow keys on the web |
Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter | A surface for related content and actions; with onPress it lifts on hover |
Accordion, AccordionItem, AccordionTrigger, AccordionContent | Sections that open and close, one or many at a time |
Collapsible, CollapsibleTrigger, CollapsibleContent | One section that shows and hides, with any icon, position and turn |
DisclosureIcon | The turning open/closed icon on its own |
Image | A 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 |
Avatar | A picture with an initials fallback |
AvatarGroup | Overlapping avatars with a +N for the rest |
Badge | A small label for status and counts |
Alert, AlertTitle, AlertDescription | A banner, announced to screen readers when it's an error |
Skeleton | A pulsing placeholder while content loads |
Progress, Spinner | A progress bar, determinate or sweeping, and the platform's activity indicator |
EmptyState | An icon, heading, next step and action for an empty screen |
List, ListItem | Grouped rows for settings and menus: values, switches, chevrons |
Table, sortRows, compareValues | Rows and columns: custom cells, sortable headers, pressable and striped rows, sideways scroll |
DescriptionList | Terms and their details, side by side or stacked |
Stat | A KPI tile: label, figure, green or red change with an arrow |
Kbd | Keyboard keys and shortcuts, read aloud as words |
SwipeableRow | Swipe a row for leading and trailing actions; full swipe; one open row at a time |
SortableList, SortableHandle, moveItem | Drag to reorder: long press or a handle, auto-scroll, keyboard and screen-reader moves |
Carousel, Pager, PageIndicator | Swipe between pages or peeking slides: dots, arrows on the web, loop, autoplay, arrow keys |
QRCode, createQRCode | A scannable QR code drawn with views: UTF-8, levels L to H, versions 1–40, a logo |
MessageBubble, ChatComposer | Chat bubbles and a composer that grows and sends on Enter |
TypingIndicator | Three dots in an incoming bubble while a reply is written, announced to screen readers |
SuggestionChips | Quick replies in a row that scrolls sideways |
Toaster, toast | Toasts from anywhere: success, error, loading and promise toasts, actions, swipe to dismiss, announced to screen readers |
Header | A screen's top bar: back button, title, actions, large title |
Tabs, TabsList, TabsTrigger, TabsContent | Panels shown one at a time, with a sliding indicator and arrow keys on the web |
BottomTabBar, NavigationRail | An app's main destinations along the bottom or down the side: badges, Material's pill indicator |
Breadcrumbs | A trail of links back up the hierarchy, long paths folded |
Pagination, getPageItems | Previous, page numbers with ellipses, Next; or a compact "Page 3 of 10" |
Steps | A stepper for checkout and onboarding: numbered steps across or down, or a progress bar |
WheelPicker<T> | Single scrolling wheel |
MultiWheelPicker | Several wheels in one band |
TimePicker | Hour / minute / second / AM-PM wheels |
TimeRangePicker | A start and an end time: opening hours, shifts, overnight ranges |
DurationPicker | A length of time in seconds: wheels, number boxes or columns |
DatePicker | Calendar (display="calendar") or wheel (display="wheel") |
Calendar | Month calendar: single / range / multiple / ranges |
DateWheelPicker | Day / month / year wheels |
MonthPicker | Month and year: wheels (iOS) or a grid of months (Material, web) |
WeekStrip | One week of days in a row, swipe or arrows to page |
ExpandableCalendar | A week that opens into its month with a drag down or its handle |
DateTimePicker | Day + time wheels (display="wheel") or calendar + time (display="calendar") |
Select<T> | Field + searchable sheet |
SelectList<T> | Inline searchable list |
CountryPicker | Country field: flags, dialing codes, localized names |
LanguagePicker | Language field: each language in itself, its name in the user's language below |
PhoneField | Phone number input: country code button, formats as you type, E.164 value |
TimeZonePicker | Time 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 |
EmojiPicker | Emoji keyboard |
ColorPicker | iOS's tabs, Google's swatch circles or the browser's spectrum; hex with opacity |
Slider | iOS's knob, Material 3's handle or a range input; one value or a range |
InputOTP | One-time code in a box per character, with SMS autofill and paste |
Rating | Stars to tap or drag, whole or half steps, or a read-only score |
SignaturePad, signatureToSvg, signatureToPath, isSignatureEmpty | Sign with a finger, pen or mouse; export the strokes as SVG |
BottomSheet | Animated sheet |
Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose | A modal window built from parts |
AlertDialog, AlertDialogAction, AlertDialogCancel | Confirm or cancel; the backdrop doesn't close it |
Modal, ModalTrigger, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalBody, ModalFooter, ModalClose | Rich content: centered with sizes, full screen on a phone, nests |
Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, DrawerClose | A side panel that slides in from either edge |
Popover, PopoverTrigger, PopoverContent, PopoverClose | A panel beside its trigger: four sides, flips and stays on screen, optional arrow, or a bottom sheet |
Tooltip, TooltipProvider | A short label on hover or keyboard focus (web) or long press (touch) |
ImageViewer | A full-screen photo lightbox: swipe, pinch and double-tap zoom, swipe down to close |
DropdownMenu | A dropdown or long-press context menu of actions by its trigger, or an action sheet |
ActionSheet | A list of actions in a sheet: iOS cards or Material rows, destructive, disabled and selected actions |
Sheets
| Export | Description |
|---|---|
PickerSheet | BottomSheet with Cancel / Done |
DatePickerSheet | Calendar or date wheel in a sheet |
TimePickerSheet | TimePicker in a sheet |
TimeRangePickerSheet | TimeRangePicker in a sheet |
DateTimePickerSheet | DateTimePicker in a sheet |
DurationPickerSheet | DurationPicker in a sheet |
MonthPickerSheet | MonthPicker in a sheet |
WheelPickerSheet<T> | WheelPicker in a sheet |
EmojiPickerSheet | EmojiPicker in a sheet |
ColorPickerSheet | ColorPicker 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
| Export | Description |
|---|---|
PickerField | Labelled field that opens the sheet its child renders |
DatePickerField | Field + DatePickerSheet; shows the date, range or dates |
TimePickerField | Field + TimePickerSheet; shows the time |
TimeRangePickerField | Field + TimeRangePickerSheet; shows the range, such as 9:00 AM – 5:00 PM |
DateTimePickerField | Field + DateTimePickerSheet; shows the date and time |
DurationPickerField | Field + DurationPickerSheet; shows 1 h 30 min |
MonthPickerField | Field + MonthPickerSheet; shows October 2026 |
WheelPickerField<T> | Field + WheelPickerSheet; shows the item's label |
EmojiPickerField | Field + EmojiPickerSheet; shows value |
ColorPickerField | Field + ColorPickerSheet; shows a swatch and the hex code |
Pro: charts
From @patine-ui/pro, drawn with react-native-svg.
| Export | Description |
|---|---|
LineChart, AreaChart | Trends over time; monotone or step curves, stacked and 100% areas, gradient fills, dashed forecasts, date axes |
BarChart | Grouped, stacked, 100% or horizontal bars; goal marks, value labels |
ComboChart | Bars with lines or areas, and a second value axis |
PieChart, DonutChart | Parts of a whole; half donuts, outside labels, the total in the donut's hole |
RadialChart | Concentric rings toward goals, like activity rings |
GaugeChart | One value on an arc with colored ranges, a target and an optional needle |
HeatmapChart | Days as a contribution calendar |
ScatterChart | Points or bubbles by group, with a trend line |
FunnelChart | Conversion through stages |
SankeyChart, proportionalFlows, collectFlows, sankeyLayout | Flows from one side to the other, each band as wide as what it carries |
RadarChart | Several measures on spokes, an outline per series |
Sparkline | A small line, area or bar trend with no axes |
StatusTracker, DEFAULT_STATUSES | A row of bars coloured by status: uptime per period |
chartPalette, contrastRatio, ensureContrast, valueFormats, CHART_DESIGN, CURVE, GRID, VALUE_FORMAT | The 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.
| Export | Description |
|---|---|
Chat | A 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 |
AIChatScreen | A whole assistant: history, prompt cards, a model picker and the chat; runs demoAssistant without a backend |
MessengerThread, ConversationList, MessengerScreen | Chat 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, ChatDetails | The message box alone (+ menu, emoji, @mentions, hold to record), and a conversation's details: people, starred messages, media, files and links |
ChannelThread | A Slack-style channel: plain rows, reaction chips, threads with a reply count, hover toolbar |
toggleReaction, castVote, parseRichText, mentionIndex, searchMessages, sharedContent, buildThreadRows, previewLine | The messenger's pure logic, for your backend stand-in or tests |
NotificationCenter, NotificationInbox | A 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, useNavbarScroll | A 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 |
Markdown | Markdown as native text, safe while it streams |
Reasoning, ToolCall, ChatSuggestions, AttachmentList | The chat's parts, for your own layout |
streamText, streamServerEvents, simulateStream | Read a fetch body or server-sent events as it downloads; fake a stream for demos |
parseMarkdown, parseInline | The Markdown parser behind Markdown |
Pro: app layout
From @patine-ui/pro.
| Export | Description |
|---|---|
AppShell | An 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, WorkspaceSwitcher | A plan-usage meter with Upgrade for the sidebar's footer, and the workspace switcher |
Page | A 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, StatusBadge | A titled card, a key number with its change, equal columns, tabular figures, a status in color and words |
DataTable, useTable | Sortable columns, bulk selection and row presses on wide screens; cards on phones |
QueryState | Content, a loading skeleton, an error with Try again, or an empty state |
CommandPalette | Search and jump anywhere, with arrow keys and Enter |
AuthShell | Sign-in screens alone on phones, beside a brand panel on desktop |
useLayout() | { width, breakpoint, wide, desktop, insets } of the space a screen draws in |
useStack | A small in-memory navigation stack |
Icon, IconButton, Pressy | Line icons by name, a 44-point labelled icon button, a pressable with hover and focus states |
formatMoney, formatAgo, formatDay, formatDelta, formatCompact, dayHeading, matches, fitColumns | Formatting 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.
| Export | Screens |
|---|---|
CryptoApp | PortfolioScreen, WelcomeScreen, MarketsScreen, AssetScreen, SwapScreen, ReceiveScreen, ActivityScreen, WalletSettingsScreen; portfolioTotals, swapQuote, applySwap, formatCoin, formatUsd |
StoreApp | DiscoverScreen, BrowseScreen, ProductScreen, BagScreen, StoreCheckoutScreen, OrderScreen, SavedScreen, StoreAccountScreen; addToBag, bagTotals, filterProducts |
BudgetApp | BudgetOverviewScreen, BudgetActivityScreen, BudgetLimitsScreen, InsightsScreen, GoalsScreen, BillsScreen, AddExpenseScreen, BudgetSettingsScreen; monthSummary, budgetsFor, goalStatus, activityByDay |
FitnessApp | TodayScreen, SetupScreen, TrainScreen, WorkoutScreen, SessionScreen, FitnessProgressScreen, ClassesScreen, FitnessProfileScreen; heartZone, sessionAt, clock |
FoodApp | FoodHomeScreen, RestaurantScreen, DishScreen, BasketScreen, TrackingScreen, CourierChatScreen, RateScreen, FoodOrdersScreen; basketTotals, unitPrice |
TravelApp | ExploreScreen, DestinationScreen, FlightsScreen, BookFlightScreen, BoardingPassScreen, TripScreen, TravelAssistantScreen, ExpensesScreen; filterFlights, settleUp |
SaasApp | AnalyticsOverviewScreen, 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>.
| Export | Description |
|---|---|
Icon | A Patine icon by name: name, variant (outline, solid, duotone, color), size, color, secondaryColor, strokeWidth, accessibilityLabel, mirror |
Glyph | Draws one icon's data (icon={iconBell}), tree-shakeable |
iconBell, iconCart, … | 669 icons as plain data: { name, tone, rtl?, paths } |
ICONS, ICON_META | Every icon by name; each icon's category and search words |
ICON_SIZE, ICON_TONE, ICON_VARIANT, ROLE | Named sizes, the color variant's palettes, the variants, path role flags |
IconName, IconProps, GlyphProps, IconGlyph, IconVariant, IconCategory, IconTone, IconPath | Types |
BrandIcon | A brand or social logo by name: name, variant (color, mono, tile), size, color, shape, accessibilityLabel. Each logo is also @patine-ui/pro/brands/<name> |
BrandGlyph | Draws one logo's data (brand={brandGithub}), tree-shakeable |
brandGithub, brandStripe, … | 147 logos as plain data: { name, title, hex, path } |
BRANDS, BRAND_META | Every logo by name; each logo's category |
BRAND_SIZE, BRAND_VARIANT, BRAND_SHAPE | Named sizes, the variants, the tile shapes |
BrandName, BrandIconProps, BrandGlyphProps, BrandGlyphData, BrandVariant, BrandShape, BrandCategory | Types |
Pro: tree view
From @patine-ui/pro.
| Export | Description |
|---|---|
TreeView | A virtualized tree: expand and collapse, single selection or checkboxes with mixed parents, lazy children, WAI-ARIA keys |
DashboardGrid, Widget | A 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, deriveLayout | A KPI that counts to its value, a widget's place in its grid, and the grid's layout logic |
AnalyticsDashboardScreen | A web analytics dashboard: ticking KPIs, revenue vs the previous period, live visitors, funnel, pages, countries, retention; date range, compare, filters and Edit dashboard |
DataGrid | Virtualized 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, aggregate | The DataGrid's own sort, filter and totals, for a server or a mock API |
MapView, MapMarker, MapRoute | A tile map without native modules: drag, pinch, wheel, markers, routes; clusterPoints, fitBounds |
DispatchScreen | A live fleet on a map: KPIs, van and order lists, stop timelines, assigning and reassigning with undo |
StoreLocatorScreen | A store finder: search, open-now and service filters, nearest-first list in sync with clustered pins, hours, call and directions |
openStatus, findStores, directionsUrl, STORE_SERVICES | The store locator's open-now wording, search and sort, and maps-app links |
CourierTrackingScreen | Live delivery tracking: the courier on the route, countdown, steps, call and chat, rating with a tip |
tripState, TRIP_STEPS, DEMO_TRIP | Where a delivery is at a given second, and its steps |
TeamChatScreen | A Slack-style team chat: channels and DMs, threads in a side panel, reactions, pins and a huddle bar |
flattenVisible, getCheckedStates, toggleChecked | The tree's pure logic: visible rows, checkbox states, cascading a check |
TREE_DESIGN, TREE_SELECTION | Each design's rows; the selection modes |
Pro: media
From @patine-ui/pro.
| Export | Description |
|---|---|
Dropzone | Drop, browse or paste files; accept, maxSize, maxFiles checks with the reasons shown |
useUpload | The upload queue: your upload(file, { onProgress, signal }) adapter, a concurrency limit, progress, speed, time left, pause, resume, retry, cancel, reorder |
FileUploadList | The queue's files: thumbnails or type tiles, progress bars, speed and time left, actions per file, a summary |
AvatarUploader | A profile photo: pick, crop in a circle, upload with a progress ring, retry |
ImageGalleryUploader | A grid of photos: add, upload over each thumbnail, remove, drag to reorder, a cover |
xhrUpload, mockUpload, browserPickFiles, fromWebFiles | A ready adapter for your endpoint, a pretend one for demos, the web's picker |
validateFiles, describeRules, matchesAccept, fileKind, formatBytes, formatDuration | The uploader's pure logic |
ImageCropper | Pan, pinch, wheel and double-tap zoom, aspects, a circle mask, rotate, flip, free-crop corners; the crop in source pixels |
cropToDataUrl | Cuts a crop out with a canvas on the web |
toSourceRect, fromSourceRect, fitBox, coverScale, aspectLabel | The cropper's math |
VideoPlayer | Video controls: poster, timeline with buffered range and hover time, volume, speed, captions, full screen, picture in picture, keyboard; renderVideo for expo-video |
AudioPlayer, MiniPlayer, TrackList | A track card with a waveform scrubber, skip and speed; a mini player bar; an episode list |
useAudioPlayer | One audio player to share; HTMLAudioElement on the web, an adapter (expo-audio) on native |
formatMediaTime, resamplePeaks | The players' pure logic: "1:02:05", a waveform fitted to its bars |
Pro: rich text editor
From @patine-ui/pro.
| Export | Description |
|---|---|
RichTextEditor | A block editor: / commands, @ mentions, Markdown shortcuts, a floating or docked toolbar, links, drag to reorder, undo, read-only rendering |
CommentComposer | A Linear-style comment box: toolbar, mentions, attachments, Cmd+Enter to send |
toMarkdown, fromMarkdown | The document to and from GitHub-flavored Markdown |
countText, isDocEmpty | Words and characters; whether nothing has been written |
BLOCK_COMMANDS, BLOCK_TYPE, MARK_TYPE, CALLOUT_TONE, TOOLBAR_ITEM, EDITOR_DESIGN | The / menu's entries, block and mark types, callout tones, toolbar buttons, each design's look |
RichTextDoc, RichTextBlock, Mark, MentionItem, BlockCommand, RichTextEditorProps, CommentComposerProps, EditorLabels | Types |
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.
| Export | Description |
|---|---|
StatsRow | KPI tiles with the change in words, trends, and selectable tiles that switch a chart |
Timeline | Events along a line with status markers, day headings, Show more, across or down |
ActivityFeed | Who did what, by day, with filters, unread dots and Load more |
OrderTracker | An order's arrival day, status, step bar, tracking number and carrier scans |
Wizard, WizardStep | A task in steps: indicators, sync and async validation, optional steps, async finish |
PricingTable | Plan cards, a comparison table or a paywall list, with a billing toggle and savings |
ProductCard | A product with sale and stock badges, wishlist, swatches and Add to cart |
ReviewList | Reviews with their summary, star filter, sorting, replies and Helpful votes |
Kanban | Columns of cards to drag, with WIP limits, a Move to menu and keyboard moves |
Agenda | The days ahead under a week strip, with a now line |
EventCalendar | Events by month, week or day, overlaps side by side |
Gantt | Tasks on a timeline with dependencies, dragged to move and stretch |
AIUsageMeter | AI tokens or credits against a limit, by model, with a forecast and Upgrade |
AgentActivity | An AI agent's steps with spinners, times, details, approvals, Stop and Try again |
ApprovalCard | An 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, toDate | The blocks' pure logic, for your own screens and servers |
…_DESIGN, DENSITY, BLOCK_LABELS and each block's …Props, item and label types |
| Export | Description |
|---|---|
PatineProvider | App-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 / darkTheme | Built-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 / TABULAR | The 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_OUT | The 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 / Pressable | The 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) |
ThemeScope | Hands 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_WEB | Whether 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
| Export | Description |
|---|---|
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
| Where | Prop | Default |
|---|---|---|
| Sheets | confirmLabel / cancelLabel | Done (iOS, web) · OK (Material) / Cancel |
| Select, fields | placeholder | Select… |
| SelectList | searchPlaceholder / emptyText / loadingText / searchPrompt | Search / No results / Loading… / Type to search |
| Select, SelectList | createLabel | Add "…" |
| ActionSheet | cancelLabel | Cancel |
| CountryPicker | placeholder / searchPlaceholder / preferredLabel / allCountriesLabel | Select a country / Search countries / Suggested / All countries |
| LanguagePicker | placeholder / searchPlaceholder / preferredLabel / allLanguagesLabel | Select a language / Search languages / Suggested / All languages |
| PhoneField | label / countrySheetTitle | none (read as Phone number) / Country code |
| TimeZonePicker | placeholder / searchPlaceholder / preferredLabel / allTimeZonesLabel | Select a time zone / Search time zones / Your time zone / All time zones |
| EmojiPicker | searchPlaceholder / emptyText | Search emoji / No emoji found |
| TimePicker | dayPeriodLabels | from locale (AM / PM) |
| TimeRangePicker | startLabel / endLabel | Start / End |
| InputOTP | accessibilityLabel | Verification code |
| Rating | accessibilityLabel / formatValue | Rating / 3 of 5 |
| ColorPicker | labels | Grid, Spectrum, Sliders, Hue, Opacity, Red, Green, Blue, Hex, Copy, Copied, Custom colour… |
| DurationPicker | labels | { hours: 'h', minutes: 'min', seconds: 's' } |
getRangePresets() | label | Today, Yesterday, Last 7 days, Last 30 days, This month, Last month |
| Carousel, Pager | labels | Previous slide / Next slide / Slide {page} of {count} |
| SortableList | labels | Move up / Move down / Moved to position {position} of {count} |
| ImageViewer | labels | Close / Previous image / Next image / Image {page} of {count} |
| SignaturePad | labels | Sign here / Clear / Signature / Signed / Empty |
| Steps | labels | Step {page} of {count} / completed / error |
| QRCode | accessibilityLabel | QR code |
Default values at a glance
| Prop | Default | Components |
|---|---|---|
itemHeight | 40 | wheels |
visibleItems | 5 | wheels |
variant | '3d' | wheels |
rotation / fadeTo | 20 / 0.3 | WheelPicker |
loop | false WheelPicker · true TimePicker, DurationPicker, DateWheelPicker, MonthPicker | wheels |
keyboardInput | true | WheelPicker |
minuteInterval / secondInterval | 1 | TimePicker, DurationPicker |
format | 'auto' | TimePicker |
display | 'wheel' iOS · 'dial' Material · 'list' web | TimePicker |
display | 'wheel' iOS · 'input' Material · 'list' web | DurationPicker |
display | 'wheel' iOS · 'grid' Material, web | MonthPicker |
display | 'tabs' iOS · 'swatches' Material · 'spectrum' web | ColorPicker |
min / max / step | 0 / 100 / 1 | Slider |
valueLabel | 'drag' Material · 'never' iOS, web | Slider |
length / inputMode | 6 / 'numeric' | InputOTP |
max / step / size | 5 / 1 / 32 | Rating |
display / timeDisplay | 'wheel' / 'wheel' iOS · 'calendar' / 'input' Material · 'calendar' / 'list' web | DateTimePicker |
timePosition | 'beside' web · 'below' other | DateTimePicker |
dayHeight | 44 | Calendar |
fixedWeeks / showOutsideDays | true | Calendar |
enableSwipe / enableQuickJump | true | Calendar |
weekdayFormat | 'short' · 'narrow' Material | Calendar |
monthFormat | 'long' | DateWheelPicker, MonthPicker |
searchable | options.length > 8 · true emoji | Select, Emoji |
closeOnSelect | true | Select, EmojiPickerSheet |
chips | true | Select |
clearable / disabled | false | Select, fields |
required | false | Select, fields, PhoneField |
columns / height | 8 / 380 (420 in sheet) | EmojiPicker |
maxRecent | 24 | EmojiPicker |
maxHeightRatio | 0.9 | BottomSheet |
bottomInset | 24 iOS · 12 other | BottomSheet |