Command palette

@yasinsensoy/native

React Native · APIs and utilities

Theme

The app root: theme, color scheme (light/dark/system), density, font and icons.

28 exports

Import

import {
  ColorSchemeScope,
  UIProvider,
  createColorScale,
  createTheme,
  trMessages,
  enMessages,
  useUI,
} from "@yasinsensoy/native";

UIProvider

component

The app root: theme, color scheme (light/dark/system), density, font and icons. Uses the same names and the same tokens as the web UIProvider; the same theme gives the same colors on both platforms.

UIProvider({ children, theme, defaultColorScheme, forcedColorScheme, storage, storageKey, density, fontFamily, icons, messages, locale, currency, safeAreaInsets, appearance, scaling, transition, licenseKey, }: UIProviderProps): JSX.Element

Examples

import { UIProvider } from "@yasinsensoy/native/theme";

export default function App() {
  return (
    <UIProvider theme={theme} fontFamily="Inter">
      <Screen />
    </UIProvider>
  );
}

Renders the subtree with the app's theme but the given color scheme: library components (Slider, Menu, confirm…) use this scheme's colors. For fullscreen views that are always dark (media editor, camera) or a card that is always light. Counterpart of the dark class on web.

ColorSchemeScope({ scheme, children }: ColorSchemeScopeProps): JSX.Element

Examples

<ColorSchemeScope scheme="dark">
  <Slider value={volume} onValueChange={setVolume} />
</ColorSchemeScope>

50–950 shade scale of a color (equal perceptual steps in OKLCH). The color itself is placed on the step closest to its lightness; the other steps are derived from there. Chroma is clipped to fit in sRGB.

createColorScale(color: string): ColorScale

Examples

const blue = createColorScale("#2563eb");
blue[100]; // "oklch(0.936 0.032 264.1)"

createTheme

function

Generates all color tokens of the light and dark themes from a single primary color: grays such as background, card, border and muted text are slightly tinted toward the primary; the text color on filled colors is chosen by contrast; for the dark theme colors are lightened enough to stay readable. The result also includes a WCAG contrast check of important pairs.

Pure function; runs on the server. Convert the output to CSS with themeToCss or pass it to a container as style.

createTheme(options: CreateThemeOptions): GeneratedTheme

Examples

const theme = createTheme({ primary: "#2563eb", neutralTint: 0.4, radius: 0.5 });
const css = themeToCss(theme, { name: "brand" });
theme.contrast.filter((c) => !c.pass); // weak pairs

trMessages

constant

Turkish texts (default). Same values as trMessages.ui on web.

trMessages: NativeMessages

enMessages

constant

English texts. Same values as enMessages.ui on web.

enMessages: NativeMessages

useUI

function

Theme values: colors, radii, spacing unit, font and color scheme preference. For drawing your own components consistently with the library.

useUI(): UIContextValue

Examples

const { colors, radius, space } = useUI();
<View style={{ backgroundColor: colors.card, borderRadius: radius.lg, padding: space(4) }} />

Tone

type

Semantic color of components. The same names are used across the library (web and React Native) (Button, Badge, Alert, Progress, toast…).

  • primary: the theme's primary color.
  • neutral: uncolored, plain.
  • danger: errors and irreversible actions.
  • success: success and confirmation.
  • warning: warning.
type Tone = "primary" | "neutral" | "danger" | "success" | "warning"

Size

type

Common component sizes.

type Size = "sm" | "md" | "lg"

Result of createTheme.

NameTypeDescription
lightThemeTokensLight theme tokens.
darkThemeTokensDark theme tokens.
radiusstring--ui-radius value.
scaleColorScale50–950 shade scale of the primary color.
contrastContrastCheck[]Contrast check of important text/background pairs, for both themes.

The library components' own texts (screen reader names, alerts). Keys are the same as UIMessages on web; the ui section of the dictionary you use on web works here too: <UIProvider messages={{ close: "Dismiss" }}>. Turkish is the default; for ready-made English see enMessages.

Placeholders in braces ({count}) are filled at runtime.

NameTypeDefaultDescription
closestring"Kapat"Close (×) button.
loadingstring"Yükleniyor"Loading indicator.
clearstring"Temizle"Clear button.
removestring"Kaldır"Remove tag button.
codestring"Kod"Screen reader name of a code block without a title.
copystring"Kopyala"Copy button in a code block.
copiedstring"Kopyalandı"When copying succeeds.
unchangedLinesstring"değişmeyen satır"Button of a collapsed region in a code diff; the line count comes first ("12 değişmeyen satır").
expandstring"Tümünü göster"Button that expands collapsed content.
collapsestring"Daralt"Button that collapses the content again.
previousstring"Önceki"Previous (page, image).
nextstring"Sonraki"Next (page, image).
incrementstring"Artır"Increment button of a number field.
decrementstring"Azalt"Decrement button of a number field.
showPasswordstring"Şifreyi göster"Show button of a password field.
hidePasswordstring"Şifreyi gizle"Hide button of a password field.
maskInvalidstring"Girilen değer geçerli değil."A masked field value whose checksum fails (e.g. a wrong IBAN).
otpResendstring"Kodu tekrar gönder"Resend the one-time code.
otpResendInstring"{time} sonra tekrar gönderebilirsin"Time left before resending; {time} is the duration.
sliderStartstring"Başlangıç"First thumb of a range slider.
sliderEndstring"Bitiş"Second thumb of a range slider.
ratingValuestring"{value} / {max}"Screen reader text of a rating.
tagDuplicatestring"Bu etiket zaten ekli"When the same tag is typed again.
tagLimitstring"En fazla {count} etiket eklenebilir"When the tag limit is reached; {count} is the limit.
tagTooLongstring"Etiket en fazla {count} karakter olabilir"When a tag is too long.
tagInvalidstring"Geçersiz etiket"When the tag does not match the rule.
tagNotInListstring"Listeden bir öğe seç"A tag not in the suggestions (allowCustomValue={false}).
tagAddedstring"{label} eklendi"For screen readers: tag added.
tagRemovedstring"{label} kaldırıldı"To the screen reader: tag removed.
showMorestring"Devamını göster"Button that expands long text.
showLessstring"Daha az göster"Button that shortens expanded text.
loadErrorstring"Yüklenemedi"When loading fails.
retrystring"Tekrar dene"Retry button.
loadMorestring"Daha fazla göster"
pagesstring"Sayfalar"
pagestring"{page}. sayfa"
previousPagestring"Önceki sayfa"
nextPagestring"Sonraki sayfa"
firstPagestring"İlk sayfa"
lastPagestring"Son sayfa"
pageStatusstring"Sayfa {page} / {count}"
pageStatusUnknownstring"Sayfa {page}"
paginationSummarystring"{total} kayıttan {start}–{end} arası"
paginationRangestring"{start}–{end} arası"
paginationEmptystring"Kayıt yok"
stepsstring"Adımlar"
stepOfstring"Adım {index} / {count}"
stepOptionalstring"İsteğe bağlı"
stepCompletestring"tamamlandı"
stepErrorstring"hatalı"
stepWarningstring"uyarı var"
stepSkippedstring"atlandı"
emptyTitlestring"Henüz içerik yok"
emptySearchTitlestring"Sonuç bulunamadı"
emptySearchDescriptionstring"Aramanı ya da filtreleri değiştirip tekrar dene."
emptyErrorTitlestring"Bir şeyler ters gitti"
emptyErrorDescriptionstring"İçerik yüklenemedi. Biraz sonra tekrar dene."
emptyOfflineTitlestring"İnternet bağlantısı yok"
emptyOfflineDescriptionstring"Bağlantın gelince kaldığın yerden devam edebilirsin."
emptyNoAccessTitlestring"Bu içeriği görme yetkin yok"
emptyNoAccessDescriptionstring"Erişim için yöneticine başvur."
statIncreasestring"{value} artış"
statDecreasestring"{value} azalış"
statNoChangestring"Değişim yok"
shownOfstring"{total} kayıttan {count} tanesi gösteriliyor"
stepNextstring"Sonraki"
endOfListstring"Hepsi bu kadar"
signatureLabelstring"İmza alanı"
signatureHintstring"Buraya imzala"
undostring"Geri al"
redostring"Yinele"
chartEmptystring"Gösterilecek veri yok"
chartTotalstring"Toplam"
chartOtherstring"Diğer"
searchstring"Ara…"
selectstring"Seçiniz"
noOptionsstring"Seçenek yok"
noResultsstring"Sonuç bulunamadı"
addCustomstring"Eklemek için Enter"
calendarstring"Takvim"
previousMonthstring"Önceki ay"
nextMonthstring"Sonraki ay"
previousYearsstring"Önceki yıllar"
nextYearsstring"Sonraki yıllar"
chooseMonthYearstring"Ay ve yıl seç"
todaystring"Bugün"
openCalendarstring"Takvimi aç"
rangeDaysstring"{count} gün"
rangeStartstring"Başlangıç"
rangeEndstring"Bitiş"
hourstring"Saat"
minutestring"Dakika"
nowstring"Şimdi"
openTimestring"Saat seç"
timePlaceholderstring"SS:DD"
thisMonthstring"Bu ay"
lastMonthstring"Geçen ay"
thisYearstring"Bu yıl"
openMonthPickerstring"Ay seçiciyi aç"
openYearPickerstring"Yıl seçiciyi aç"
previousYearstring"Önceki yıl"
nextYearstring"Sonraki yıl"
treeEmptystring"Öğe yok"
treeEmptyFolderstring"Boş"
treeMatchesstring"{count} sonuç"
carouselstring"Karusel"
carouselSlidestring"slayt"
carouselGoTostring"{index}. slayta git"
galleryPositionstring"{index} / {count}"
playstring"Oynat"
pausestring"Duraklat"
chartZoomInstring"Yakınlaştır"
chartZoomOutstring"Uzaklaştır"
chartZoomResetstring"Yakınlaştırmayı sıfırla"
fileSelectstring"Dosya seç"Main button of the file upload field.
fileNonestring"Dosya seçilmedi"When nothing is selected.
fileCountstring"{count} dosya"While multiple files are selected; {count} is replaced with the number.
fileAddstring"Ekle"Add box in the gallery.
fileReplacestring"Değiştir"Replace the file in a single-file field.
fileQueuedstring"Sırada"A file waiting in the upload queue.
fileFailedstring"Yüklenemedi"When an upload fails.
fileMaxSizestring"En fazla {size}"Maximum size in the hint; {size} is replaced with the size.
fileMaxCountstring"En fazla {count} dosya"Maximum number of files in the hint.
fileTypeErrorstring"Bu dosya türü kabul edilmiyor"A file whose type is not accepted.
fileSizeErrorstring"Dosya çok büyük (en fazla {size})"A file that is too large.
fileMinSizeErrorstring"Dosya çok küçük (en az {size})"A file that is too small.
fileCountErrorstring"En fazla {count} dosya seçilebilir"When the count limit is exceeded.
fileDuplicateErrorstring"Bu dosya zaten ekli"When the same file is added twice.
moreActionsstring"Diğer eylemler"The "More" (⋯) menu collecting buttons that do not fit.
imageErrorstring"Resim yüklenemedi"Text shown when an image fails to load.
captionsstring"Altyazı"Video: captions menu and button.
captionsOffstring"Kapalı"Video: option that turns captions off.
exitFullscreenstring"Tam ekrandan çık"Video: exit fullscreen button.
fullscreenstring"Tam ekran"Video: fullscreen button.
mutestring"Sesi kapat"Video: mute button.
normalSpeedstring"Normal"Video: name of the 1× speed.
playbackSpeedstring"Oynatma hızı"Video: title of the speed menu.
qualitystring"Kalite"Video: title of the quality menu.
seekstring"Video konumu"Video: screen reader name of the seek bar.
seekBackwardstring"{seconds} sn geri"Video: skip-back notice on double tap ({seconds} seconds).
seekForwardstring"{seconds} sn ileri"Video: skip-forward notice on double tap ({seconds} seconds).
settingsstring"Ayarlar"Video: settings menu.
unmutestring"Sesi aç"Video: unmute button.
videostring"Video"Default name of the video element and the player.
videoErrorstring"Video oynatılamadı"Text shown when a video cannot be opened.
volumestring"Ses düzeyi"Video: volume.
downloadstring"İndir"Fullscreen viewer: download (share sheet) button.
gallerystring"Galeri"Default name of the gallery and the fullscreen viewer.
gallerySelectstring"Seç"Gallery: item selection circle.
gallerySelectedstring"{count} seçildi"Gallery: selected count ({count}).
linkCopiedstring"Bağlantı kopyalandı"Notice that the link was copied to the clipboard when sharing is unavailable.
processingstring"İşleniyor"Gallery: item being processed on the server.
sharestring"Paylaş"Share button.
shareFailedstring"Paylaşılamadı"Sharing failed notice.
slideshowstring"Slayt gösterisi"Fullscreen viewer: start slideshow.
stopSlideshowstring"Slaytı durdur"Fullscreen viewer: stop slideshow.
uploadFailedstring"Yüklenemedi"Gallery: item that failed to load.
uploadingstring"Yükleniyor"Gallery: item loading.
deselectAllstring"Seçimi kaldır"Gallery: button that ends selection.
galleryEmptystring"Gösterilecek öğe yok"Text shown when the gallery has no items.
galleryPreviewstring"Büyük gör"Gallery: view an item large in selection mode.
selectAllstring"Tümünü seç"Gallery: select all button.
yesterdaystring"Dün"Date group: yesterday.
fieldArrayAddstring"Ekle"Add row button.
fieldArrayRemovestring"{row} sil"Delete row button; {row} is the row's name.
fieldArrayDuplicatestring"{row} çoğalt"Duplicate row button.
fieldArrayRowstring"{position}. satır"Default row name; {position} is its index.
fieldArrayAddedstring"{row} eklendi"Announcement when a row is added.
fieldArrayRemovedstring"{row} silindi"Announcement when a row is deleted.
fieldArrayEmptystring"Henüz satır yok"When there are no rows.
fieldArrayMaxstring"En fazla {max} satır eklenebilir"When the maximum number of rows is reached.
sortablePickedUpstring"{label} alındı. Sıra {position} / {total}."Announcement when a drag starts.
sortableDroppedstring"{label} bırakıldı. Yeni sıra {position} / {total}."Announcement on drop.
sortableCancelledstring"Taşıma iptal edildi. {label} yerinde kaldı."Announcement when a move is cancelled.
sortableTouchHintstring"Taşımak için basılı tutup sürükle ya da işlemlerden yukarı/aşağı taşı."Screen reader hint of a sortable item on touch.
moveUpstring"Yukarı taşı"Move up action.
moveDownstring"Aşağı taşı"Move down action.
dragHandlestring"Sürükle"Name of the drag handle.
formSubmitstring"Gönder"SchemaForm submit button.
formResetstring"Temizle"SchemaForm reset button.
countryPrioritystring"Sık kullanılanlar"Featured group in the country list.
countrySearchstring"Ülke ara"Placeholder of the country search.
phoneCountrystring"Ülke kodu"Name of the country picker in the phone field.
phoneInvalidstring"Geçerli bir telefon numarası gir"Invalid phone number message.
colorPickstring"Renk seç"colorPick
colorAreastring"Renk alanı"colorArea
colorSaturationstring"Doygunluk"colorSaturation
colorBrightnessstring"Parlaklık"colorBrightness
colorHuestring"Ton"colorHue
colorAlphastring"Saydamlık"colorAlpha
colorValuestring"Renk değeri"colorValue
colorFormatstring"Renk biçimi: {format}"colorFormat
colorSwatchesstring"Hazır renkler"colorSwatches
colorRecentstring"Son kullanılanlar"colorRecent
colorNonestring"Renk yok"colorNone
cascaderBackstring"Üst seviyeye dön"cascaderBack
transferSourcestring"Kaynak"transferSource
transferTargetstring"Seçilenler"transferTarget
transferEmptystring"Öğe yok"transferEmpty
transferAddstring"Seçilenleri ekle"transferAdd
transferAddAllstring"Tümünü ekle"transferAddAll
transferRemovestring"Seçilenleri çıkar"transferRemove
transferRemoveAllstring"Tümünü çıkar"transferRemoveAll
transferMoveUpstring"Yukarı taşı"transferMoveUp
transferMoveDownstring"Aşağı taşı"transferMoveDown
transferMovedstring"{count} öğe taşındı"transferMoved
transferMaxstring"En fazla {max} öğe seçilebilir"transferMax
wizardBackstring"Geri"wizardBack
wizardFinishstring"Tamamla"wizardFinish
wizardNextstring"İleri"wizardNext
wizardSkipstring"Atla"wizardSkip
fileEditstring"Düzenle"fileEdit
jsonViewstring"JSON"jsonView
jsonExpandAllstring"Tümünü aç"jsonExpandAll
jsonCollapseAllstring"Tümünü kapat"jsonCollapseAll
jsonCopyAllstring"JSON'u kopyala"jsonCopyAll
jsonCopyValuestring"Değeri kopyala"jsonCopyValue
jsonCopyPathstring"Yolu kopyala"jsonCopyPath
jsonKeysstring"{count} anahtar"jsonKeys
jsonItemsstring"{count} öğe"jsonItems
jsonMoreCharsstring"+{count} karakter"jsonMoreChars
jsonInvalidstring"Geçersiz JSON"jsonInvalid
countdownEndedstring"Süre doldu"countdownEnded
hiddenPagesstring"Gizlenen sayfalar"hiddenPages
otherPagesstring"Diğer sayfalar"otherPages
backToTopstring"Başa dön"backToTop
notificationsstring"Bildirimler"notifications
notificationsAllstring"Tümü"notificationsAll
notificationsUnreadstring"Okunmamış"notificationsUnread
notificationsMarkAllReadstring"Tümünü okundu işaretle"notificationsMarkAllRead
notificationsMarkReadstring"Okundu işaretle"notificationsMarkRead
notificationsClearstring"Tümünü temizle"notificationsClear
notificationsEmptystring"Henüz bildirim yok"notificationsEmpty
notificationsEmptyUnreadstring"Okunmamış bildirim yok"notificationsEmptyUnread
notificationsUnreadCountstring"{count} okunmamış"notificationsUnreadCount
notificationsNewstring"Yeni bildirim: {title}"notificationsNew
cancelstring"İptal"Cancel button.
commandBackstring"Geri"Button that returns to the parent page in the command palette.
commandPalettestring"Komut paleti"Accessible name of the command palette.
commandPlaceholderstring"Komut ya da arama yazın…"Search box of the command palette.
commandRecentstring"Son kullanılanlar"Recently used group in the command palette.
navigationstring"Ana menü"navigation
expandSidebarstring"Kenar çubuğunu genişlet"expandSidebar
collapseSidebarstring"Kenar çubuğunu daralt"collapseSidebar
menustring"Menü"menu
openMenustring"Menüyü aç"openMenu
morestring"Daha fazla"more
tableOfContentsstring"Bu sayfada"Title of the table of contents.
confirmstring"Onayla"Confirm button of a confirmation dialog.
sheetHandlestring"Panel boyutu"Drag handle of a Sheet (screen reader).
breadcrumbstring"Sayfa yolu"Screen reader name of the Breadcrumb.
tableEmptystring"Kayıt yok"Table with no rows.
timelineEmptystring"Henüz kayıt yok"Timeline with no entries.
timelineDonestring"Tamamlandı"Screen reader text of a Timeline entry with the "done" status.
timelineActivestring"Şu anki adım"Screen reader text of a Timeline entry with the "active" status.
timelinePendingstring"Bekliyor"Screen reader text of a Timeline entry with the "pending" status.
timelineShowMorestring"{count} kayıt daha göster"Timeline button revealing hidden entries; {count} is replaced.
timelineGroupCountstring"{count} kayıt"Entry count in a collapsible Timeline group heading; {count} is replaced.
tourNextstring"İleri"Tour next button.
tourBackstring"Geri"Tour back button.
tourDonestring"Bitir"Tour button on the last step.
tourSkipstring"Geç"Tour button in place of Back on the first step.
tourClosestring"Turu kapat"Tour close (×) button.
colorNamesColorNameMessagesNames of the built-in ColorPicker swatches.

The user's color scheme preference: "system" follows the operating system.

type ColorSchemePreference = ColorScheme | "system"

setColorScheme options.

NameTypeDescription
transition?ThemeTransitionAnimation for this change; overrides the provider's transition.
origin?ThemeTransitionOriginStart point of spreading animations (ripple, circle): an onPress event or window coordinates. Defaults to the last touched spot.

Density: proportionally shrinks or grows all spacing and heights (same factors as UIProvider density on web). Touch targets never go below 44 pixels.

type Density = "compact" | "standard" | "comfortable"

Icon component: any component taking size and color (your own icons or an icon library).

type NativeIconComponent = ComponentType<{ size: number; color: string; }>

Icons by name: drawing data (IconData, drawn with the library's native drawing view) or a component.

type NativeIconRegistry = Readonly<Record<string, IconData | NativeIconComponent>>

Where the preference is stored. To avoid extra dependencies the library has no storage of its own; connect the storage you use (MMKV, AsyncStorage, your own native module) via this interface. If omitted the preference is kept only in memory.

NameTypeDescription
get(key: string): unknownReads the stored value (a string is expected; anything else is ignored). May return synchronously or a Promise. A @yasinsensoy/native/storage store can be passed directly.
set(key: string, value: string): unknownStores the value.

UIProvider props.

NameTypeDefaultDescription
children?ReactNodeApp.
theme?ThemeInput | GeneratedThemeTheme: the output of createTheme or the changed tokens. See ThemeInput. Define the object outside the component (passing a new object on every render defeats the cache).
defaultColorScheme?ColorSchemePreference"system"Initial color scheme preference. A stored preference is used if present.
forcedColorScheme?ColorSchemeWhen given, the user preference is ignored and this scheme always applies.
storage?PreferenceStorageWhere the preference is stored. See PreferenceStorage.
storageKey?string"ui-theme"` (same as web)Storage key.
density?Density"standard"Density. See Density.
fontFamily?FontFamilyFont. See FontFamily. If omitted, the platform font (iOS San Francisco, Android Roboto: looks different on the two platforms). For the same text on both platforms the library's ready font is inter (@yasinsensoy/native/font).
scaling?ScalingOptions | false{ baseWidth: 390, strength: 0.5, fontStrength: 0.4, min: 0.85, max: 1.2 }Device scaling: component sizes, spacing and text grow/shrink with the window size and update live when the window changes (foldable screen, split screen, rotation). For your own styles use useScale() / createStyles() (@yasinsensoy/native/responsive). false disables it. See ScalingOptions.
icons?NativeIconRegistryThe app's icons; every prop taking icon="name" resolves from here. The library's own icons (check, close, chevronDown…) are always present; an icon given with the same name overrides them.
messages?Partial<NativeMessages>Turkish (`trMessages`)Component texts: the changed ones or a ready language (enMessages). See NativeMessages. Define the object outside the component.
locale?string"tr-TR"Locale for number and date formatting (BCP 47, e.g. "tr-TR", "en-US").
currency?string"TRY"Currency (ISO 4217, e.g. "TRY", "USD"); read by those using format="currency".
safeAreaInsets?Partial<Insets>Manually overrides the safe area insets. Dialog, Sheet, Toast, floating panels and SafeAreaView lay out by these values. If omitted the values come live from the library's own native module (notch, Dynamic Island, status/navigation bars, display cutout); given edges override them (tests, screenshots). See useSafeAreaInsets.
appearance?AppearanceConfigAppearance settings: component defaults (variant, effect, tone), custom effects and custom appearances. See AppearanceConfig. Define the object outside the component.
transition?ThemeTransition"none"Animation played while the color scheme changes (same types and same drawing as UIProvider transition on web). See ThemeTransitionType. For a single change use setColorScheme(scheme, { transition }).
licenseKey?stringLicense key. The library runs free, without a key, in development (__DEV__). In a release build it requires a valid key; if it is missing, invalid, or this version was released after the license's update window, the app is covered by a non-dismissable "License required" screen. The key is verified offline (no network request).

The useUI value.

NameTypeDescription
colorSchemeColorSchemePreferenceThe user's preference (may be "system").
setColorScheme(scheme: ColorSchemePreference, options?: SetColorSchemeOptions) => voidChanges the preference and stores it (if storage was given). If the provider has transition, the change is shown with an animation.
densitynumberDensity factor (standard = 1).
space(steps: number) => numberSpacing unit: same as the Tailwind scale on web (space(4) = 16 px × density). p-4 → space(4).
font(weight: FontWeightInput, italic?: boolean) => FontStyleFont style by weight (and italic); only the weight if there is no fontFamily. Picks the right file in a family with a file per weight.
fontFamilyFontFamily | undefinedFont family (UIProviderProps.fontFamily).
scaleScalerDevice scaler: scale.s(20) for sizes, scale.fs(16) for text. Refreshed when the window changes. See Scaler.
iconsNativeIconRegistry | undefinedThe app's icons.
messagesNativeMessagesComponent texts (missing ones filled with the Turkish defaults).
localestringLocale for number and date formatting.
currencystringCurrency.
appearanceAppearanceConfigAppearance settings (UIProviderProps.appearance); empty if not given.
schemeColorSchemeActive color scheme.
colorsThemeColorsColors. See ThemeColors.
chartreadonly string[]Ordered colors of chart series.
codeCodeThemeColorsCode block colors. See CodeThemeColors.
radius{ sm: number; md: number; lg: number; xl: number; }Corner radii (pixels), same scale as web: sm = radius − 4, md = radius − 2, lg = radius, xl = radius + 4.

ColorSchemeScope props.

NameTypeDescription
schemeColorSchemeColor scheme of the subtree.
childrenReactNodeContent.

Theme colors; rgba() strings React Native understands. Names match the web tokens, only written in camelCase (--ui-primary-foreground → primaryForeground).

type ThemeColors = { [K in ThemeTokenName as CamelCase<K>]: string; }

Light or dark color scheme.

type ColorScheme = "light" | "dark"

ThemeInput

interface

Theme given to the app: the output of createTheme or only the tokens to change. Values use the same formats as web (hex, rgb, hsl, oklch); converted automatically for React Native.

NameTypeDefaultDescription
light?Partial<ThemeTokens>Light theme tokens; those not given use defaults.
dark?Partial<ThemeTokens>Dark theme tokens; those not given use defaults.
radius?number | string10` (`0.625rem` on web)Corner radius: a number is pixels (10), text is rem as on web ("0.625rem") or pixels ("10px").
code?{ light?: Partial<CodeColors>; dark?: Partial<CodeColors>; }Code block colors (--ui-code-* on web); those not given use defaults.

Examples

<UIProvider theme={createTheme({ primary: "#2563eb" })}>…</UIProvider>
<UIProvider theme={{ light: { primary: "#16a34a" }, radius: 12 }}>…</UIProvider>

ResolvedTheme

interface

Resolved theme: the values components read.

NameTypeDescription
schemeColorSchemeActive color scheme.
colorsThemeColorsColors. See ThemeColors.
chartreadonly string[]Ordered colors of chart series.
codeCodeThemeColorsCode block colors. See CodeThemeColors.
radius{ sm: number; md: number; lg: number; xl: number; }Corner radii (pixels), same scale as web: sm = radius − 4, md = radius − 2, lg = radius, xl = radius + 4.

Animations that can play on a theme change (same names and same drawing as web).

  • "none": changes instantly.
  • "fade": the new theme fades in slowly.
  • "ripple": a water drop; a drop falls on the touched spot and the new theme spreads from there as a circle with a wavy edge, a bright wave crest moving ahead of it.
  • "circle": spreads from the touched spot as a sharp-edged circle.
  • "wipe": the new theme comes down like a curtain from top to bottom.
  • "blur": the old theme blurs while the new one appears over it.

The library's native module draws the animation: a snapshot of the screen is placed on top of the window, the new theme is rendered underneath and the snapshot is revealed with the chosen animation. It flows without stutter even while JS is busy; it looks the same on iOS and Android. With reduced motion on, when the chosen theme does not change the view, or without the native module (e.g. web, tests) it changes instantly.

type ThemeTransitionType = "none" | "fade" | "ripple" | "circle" | "wipe" | "blur"

Detailed settings of a theme transition.

NameTypeDefaultDescription
typeThemeTransitionTypeAnimation type.
duration?numberfade` 500, `ripple` 900 (including the drop's fall), `circle` 550, `wipe` 600, `blur` 500Duration (milliseconds).
easing?stringA smooth curve chosen per type.Easing curve: CSS syntax ("ease-out", "cubic-bezier(0.4, 0, 0.2, 1)").

A theme transition: just the type name or detailed settings.

type ThemeTransition = ThemeTransitionType | ThemeTransitionOptions

Start point of spreading animations (ripple, circle): a touch event (the onPress event) or window coordinates.

type ThemeTransitionOrigin = GestureResponderEvent | { pageX: number; pageY: number; } | { x: number; y: number; }