React Native · APIs and utilities
Theme
The app root: theme, color scheme (light/dark/system), density, font and icons.
Import
UIProvider
componentThe 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.
Examples
ColorSchemeScope
componentRenders 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.
Examples
createColorScale
function50–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.
Examples
createTheme
functionGenerates 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.
Examples
trMessages
constantTurkish texts (default). Same values as trMessages.ui on web.
enMessages
constantEnglish texts. Same values as enMessages.ui on web.
useUI
functionTheme values: colors, radii, spacing unit, font and color scheme preference. For drawing your own components consistently with the library.
Examples
Tone
typeSemantic 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.
Size
typeCommon component sizes.
GeneratedTheme
interfaceResult of createTheme.
| Name | Type | Description |
|---|---|---|
light | ThemeTokens | Light theme tokens. |
dark | ThemeTokens | Dark theme tokens. |
radius | string | --ui-radius value. |
scale | ColorScale | 50–950 shade scale of the primary color. |
contrast | ContrastCheck[] | Contrast check of important text/background pairs, for both themes. |
NativeMessages
interfaceThe 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.
| Name | Type | Default | Description |
|---|---|---|---|
close | string | "Kapat" | Close (×) button. |
loading | string | "Yükleniyor" | Loading indicator. |
clear | string | "Temizle" | Clear button. |
remove | string | "Kaldır" | Remove tag button. |
code | string | "Kod" | Screen reader name of a code block without a title. |
copy | string | "Kopyala" | Copy button in a code block. |
copied | string | "Kopyalandı" | When copying succeeds. |
unchangedLines | string | "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"). |
expand | string | "Tümünü göster" | Button that expands collapsed content. |
collapse | string | "Daralt" | Button that collapses the content again. |
previous | string | "Önceki" | Previous (page, image). |
next | string | "Sonraki" | Next (page, image). |
increment | string | "Artır" | Increment button of a number field. |
decrement | string | "Azalt" | Decrement button of a number field. |
showPassword | string | "Şifreyi göster" | Show button of a password field. |
hidePassword | string | "Şifreyi gizle" | Hide button of a password field. |
maskInvalid | string | "Girilen değer geçerli değil." | A masked field value whose checksum fails (e.g. a wrong IBAN). |
otpResend | string | "Kodu tekrar gönder" | Resend the one-time code. |
otpResendIn | string | "{time} sonra tekrar gönderebilirsin" | Time left before resending; {time} is the duration. |
sliderStart | string | "Başlangıç" | First thumb of a range slider. |
sliderEnd | string | "Bitiş" | Second thumb of a range slider. |
ratingValue | string | "{value} / {max}" | Screen reader text of a rating. |
tagDuplicate | string | "Bu etiket zaten ekli" | When the same tag is typed again. |
tagLimit | string | "En fazla {count} etiket eklenebilir" | When the tag limit is reached; {count} is the limit. |
tagTooLong | string | "Etiket en fazla {count} karakter olabilir" | When a tag is too long. |
tagInvalid | string | "Geçersiz etiket" | When the tag does not match the rule. |
tagNotInList | string | "Listeden bir öğe seç" | A tag not in the suggestions (allowCustomValue={false}). |
tagAdded | string | "{label} eklendi" | For screen readers: tag added. |
tagRemoved | string | "{label} kaldırıldı" | To the screen reader: tag removed. |
showMore | string | "Devamını göster" | Button that expands long text. |
showLess | string | "Daha az göster" | Button that shortens expanded text. |
loadError | string | "Yüklenemedi" | When loading fails. |
retry | string | "Tekrar dene" | Retry button. |
loadMore | string | "Daha fazla göster" | |
pages | string | "Sayfalar" | |
page | string | "{page}. sayfa" | |
previousPage | string | "Önceki sayfa" | |
nextPage | string | "Sonraki sayfa" | |
firstPage | string | "İlk sayfa" | |
lastPage | string | "Son sayfa" | |
pageStatus | string | "Sayfa {page} / {count}" | |
pageStatusUnknown | string | "Sayfa {page}" | |
paginationSummary | string | "{total} kayıttan {start}–{end} arası" | |
paginationRange | string | "{start}–{end} arası" | |
paginationEmpty | string | "Kayıt yok" | |
steps | string | "Adımlar" | |
stepOf | string | "Adım {index} / {count}" | |
stepOptional | string | "İsteğe bağlı" | |
stepComplete | string | "tamamlandı" | |
stepError | string | "hatalı" | |
stepWarning | string | "uyarı var" | |
stepSkipped | string | "atlandı" | |
emptyTitle | string | "Henüz içerik yok" | |
emptySearchTitle | string | "Sonuç bulunamadı" | |
emptySearchDescription | string | "Aramanı ya da filtreleri değiştirip tekrar dene." | |
emptyErrorTitle | string | "Bir şeyler ters gitti" | |
emptyErrorDescription | string | "İçerik yüklenemedi. Biraz sonra tekrar dene." | |
emptyOfflineTitle | string | "İnternet bağlantısı yok" | |
emptyOfflineDescription | string | "Bağlantın gelince kaldığın yerden devam edebilirsin." | |
emptyNoAccessTitle | string | "Bu içeriği görme yetkin yok" | |
emptyNoAccessDescription | string | "Erişim için yöneticine başvur." | |
statIncrease | string | "{value} artış" | |
statDecrease | string | "{value} azalış" | |
statNoChange | string | "Değişim yok" | |
shownOf | string | "{total} kayıttan {count} tanesi gösteriliyor" | |
stepNext | string | "Sonraki" | |
endOfList | string | "Hepsi bu kadar" | |
signatureLabel | string | "İmza alanı" | |
signatureHint | string | "Buraya imzala" | |
undo | string | "Geri al" | |
redo | string | "Yinele" | |
chartEmpty | string | "Gösterilecek veri yok" | |
chartTotal | string | "Toplam" | |
chartOther | string | "Diğer" | |
search | string | "Ara…" | |
select | string | "Seçiniz" | |
noOptions | string | "Seçenek yok" | |
noResults | string | "Sonuç bulunamadı" | |
addCustom | string | "Eklemek için Enter" | |
calendar | string | "Takvim" | |
previousMonth | string | "Önceki ay" | |
nextMonth | string | "Sonraki ay" | |
previousYears | string | "Önceki yıllar" | |
nextYears | string | "Sonraki yıllar" | |
chooseMonthYear | string | "Ay ve yıl seç" | |
today | string | "Bugün" | |
openCalendar | string | "Takvimi aç" | |
rangeDays | string | "{count} gün" | |
rangeStart | string | "Başlangıç" | |
rangeEnd | string | "Bitiş" | |
hour | string | "Saat" | |
minute | string | "Dakika" | |
now | string | "Şimdi" | |
openTime | string | "Saat seç" | |
timePlaceholder | string | "SS:DD" | |
thisMonth | string | "Bu ay" | |
lastMonth | string | "Geçen ay" | |
thisYear | string | "Bu yıl" | |
openMonthPicker | string | "Ay seçiciyi aç" | |
openYearPicker | string | "Yıl seçiciyi aç" | |
previousYear | string | "Önceki yıl" | |
nextYear | string | "Sonraki yıl" | |
treeEmpty | string | "Öğe yok" | |
treeEmptyFolder | string | "Boş" | |
treeMatches | string | "{count} sonuç" | |
carousel | string | "Karusel" | |
carouselSlide | string | "slayt" | |
carouselGoTo | string | "{index}. slayta git" | |
galleryPosition | string | "{index} / {count}" | |
play | string | "Oynat" | |
pause | string | "Duraklat" | |
chartZoomIn | string | "Yakınlaştır" | |
chartZoomOut | string | "Uzaklaştır" | |
chartZoomReset | string | "Yakınlaştırmayı sıfırla" | |
fileSelect | string | "Dosya seç" | Main button of the file upload field. |
fileNone | string | "Dosya seçilmedi" | When nothing is selected. |
fileCount | string | "{count} dosya" | While multiple files are selected; {count} is replaced with the number. |
fileAdd | string | "Ekle" | Add box in the gallery. |
fileReplace | string | "Değiştir" | Replace the file in a single-file field. |
fileQueued | string | "Sırada" | A file waiting in the upload queue. |
fileFailed | string | "Yüklenemedi" | When an upload fails. |
fileMaxSize | string | "En fazla {size}" | Maximum size in the hint; {size} is replaced with the size. |
fileMaxCount | string | "En fazla {count} dosya" | Maximum number of files in the hint. |
fileTypeError | string | "Bu dosya türü kabul edilmiyor" | A file whose type is not accepted. |
fileSizeError | string | "Dosya çok büyük (en fazla {size})" | A file that is too large. |
fileMinSizeError | string | "Dosya çok küçük (en az {size})" | A file that is too small. |
fileCountError | string | "En fazla {count} dosya seçilebilir" | When the count limit is exceeded. |
fileDuplicateError | string | "Bu dosya zaten ekli" | When the same file is added twice. |
moreActions | string | "Diğer eylemler" | The "More" (⋯) menu collecting buttons that do not fit. |
imageError | string | "Resim yüklenemedi" | Text shown when an image fails to load. |
captions | string | "Altyazı" | Video: captions menu and button. |
captionsOff | string | "Kapalı" | Video: option that turns captions off. |
exitFullscreen | string | "Tam ekrandan çık" | Video: exit fullscreen button. |
fullscreen | string | "Tam ekran" | Video: fullscreen button. |
mute | string | "Sesi kapat" | Video: mute button. |
normalSpeed | string | "Normal" | Video: name of the 1× speed. |
playbackSpeed | string | "Oynatma hızı" | Video: title of the speed menu. |
quality | string | "Kalite" | Video: title of the quality menu. |
seek | string | "Video konumu" | Video: screen reader name of the seek bar. |
seekBackward | string | "{seconds} sn geri" | Video: skip-back notice on double tap ({seconds} seconds). |
seekForward | string | "{seconds} sn ileri" | Video: skip-forward notice on double tap ({seconds} seconds). |
settings | string | "Ayarlar" | Video: settings menu. |
unmute | string | "Sesi aç" | Video: unmute button. |
video | string | "Video" | Default name of the video element and the player. |
videoError | string | "Video oynatılamadı" | Text shown when a video cannot be opened. |
volume | string | "Ses düzeyi" | Video: volume. |
download | string | "İndir" | Fullscreen viewer: download (share sheet) button. |
gallery | string | "Galeri" | Default name of the gallery and the fullscreen viewer. |
gallerySelect | string | "Seç" | Gallery: item selection circle. |
gallerySelected | string | "{count} seçildi" | Gallery: selected count ({count}). |
linkCopied | string | "Bağlantı kopyalandı" | Notice that the link was copied to the clipboard when sharing is unavailable. |
processing | string | "İşleniyor" | Gallery: item being processed on the server. |
share | string | "Paylaş" | Share button. |
shareFailed | string | "Paylaşılamadı" | Sharing failed notice. |
slideshow | string | "Slayt gösterisi" | Fullscreen viewer: start slideshow. |
stopSlideshow | string | "Slaytı durdur" | Fullscreen viewer: stop slideshow. |
uploadFailed | string | "Yüklenemedi" | Gallery: item that failed to load. |
uploading | string | "Yükleniyor" | Gallery: item loading. |
deselectAll | string | "Seçimi kaldır" | Gallery: button that ends selection. |
galleryEmpty | string | "Gösterilecek öğe yok" | Text shown when the gallery has no items. |
galleryPreview | string | "Büyük gör" | Gallery: view an item large in selection mode. |
selectAll | string | "Tümünü seç" | Gallery: select all button. |
yesterday | string | "Dün" | Date group: yesterday. |
fieldArrayAdd | string | "Ekle" | Add row button. |
fieldArrayRemove | string | "{row} sil" | Delete row button; {row} is the row's name. |
fieldArrayDuplicate | string | "{row} çoğalt" | Duplicate row button. |
fieldArrayRow | string | "{position}. satır" | Default row name; {position} is its index. |
fieldArrayAdded | string | "{row} eklendi" | Announcement when a row is added. |
fieldArrayRemoved | string | "{row} silindi" | Announcement when a row is deleted. |
fieldArrayEmpty | string | "Henüz satır yok" | When there are no rows. |
fieldArrayMax | string | "En fazla {max} satır eklenebilir" | When the maximum number of rows is reached. |
sortablePickedUp | string | "{label} alındı. Sıra {position} / {total}." | Announcement when a drag starts. |
sortableDropped | string | "{label} bırakıldı. Yeni sıra {position} / {total}." | Announcement on drop. |
sortableCancelled | string | "Taşıma iptal edildi. {label} yerinde kaldı." | Announcement when a move is cancelled. |
sortableTouchHint | string | "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. |
moveUp | string | "Yukarı taşı" | Move up action. |
moveDown | string | "Aşağı taşı" | Move down action. |
dragHandle | string | "Sürükle" | Name of the drag handle. |
formSubmit | string | "Gönder" | SchemaForm submit button. |
formReset | string | "Temizle" | SchemaForm reset button. |
countryPriority | string | "Sık kullanılanlar" | Featured group in the country list. |
countrySearch | string | "Ülke ara" | Placeholder of the country search. |
phoneCountry | string | "Ülke kodu" | Name of the country picker in the phone field. |
phoneInvalid | string | "Geçerli bir telefon numarası gir" | Invalid phone number message. |
colorPick | string | "Renk seç" | colorPick |
colorArea | string | "Renk alanı" | colorArea |
colorSaturation | string | "Doygunluk" | colorSaturation |
colorBrightness | string | "Parlaklık" | colorBrightness |
colorHue | string | "Ton" | colorHue |
colorAlpha | string | "Saydamlık" | colorAlpha |
colorValue | string | "Renk değeri" | colorValue |
colorFormat | string | "Renk biçimi: {format}" | colorFormat |
colorSwatches | string | "Hazır renkler" | colorSwatches |
colorRecent | string | "Son kullanılanlar" | colorRecent |
colorNone | string | "Renk yok" | colorNone |
cascaderBack | string | "Üst seviyeye dön" | cascaderBack |
transferSource | string | "Kaynak" | transferSource |
transferTarget | string | "Seçilenler" | transferTarget |
transferEmpty | string | "Öğe yok" | transferEmpty |
transferAdd | string | "Seçilenleri ekle" | transferAdd |
transferAddAll | string | "Tümünü ekle" | transferAddAll |
transferRemove | string | "Seçilenleri çıkar" | transferRemove |
transferRemoveAll | string | "Tümünü çıkar" | transferRemoveAll |
transferMoveUp | string | "Yukarı taşı" | transferMoveUp |
transferMoveDown | string | "Aşağı taşı" | transferMoveDown |
transferMoved | string | "{count} öğe taşındı" | transferMoved |
transferMax | string | "En fazla {max} öğe seçilebilir" | transferMax |
wizardBack | string | "Geri" | wizardBack |
wizardFinish | string | "Tamamla" | wizardFinish |
wizardNext | string | "İleri" | wizardNext |
wizardSkip | string | "Atla" | wizardSkip |
fileEdit | string | "Düzenle" | fileEdit |
jsonView | string | "JSON" | jsonView |
jsonExpandAll | string | "Tümünü aç" | jsonExpandAll |
jsonCollapseAll | string | "Tümünü kapat" | jsonCollapseAll |
jsonCopyAll | string | "JSON'u kopyala" | jsonCopyAll |
jsonCopyValue | string | "Değeri kopyala" | jsonCopyValue |
jsonCopyPath | string | "Yolu kopyala" | jsonCopyPath |
jsonKeys | string | "{count} anahtar" | jsonKeys |
jsonItems | string | "{count} öğe" | jsonItems |
jsonMoreChars | string | "+{count} karakter" | jsonMoreChars |
jsonInvalid | string | "Geçersiz JSON" | jsonInvalid |
countdownEnded | string | "Süre doldu" | countdownEnded |
hiddenPages | string | "Gizlenen sayfalar" | hiddenPages |
otherPages | string | "Diğer sayfalar" | otherPages |
backToTop | string | "Başa dön" | backToTop |
notifications | string | "Bildirimler" | notifications |
notificationsAll | string | "Tümü" | notificationsAll |
notificationsUnread | string | "Okunmamış" | notificationsUnread |
notificationsMarkAllRead | string | "Tümünü okundu işaretle" | notificationsMarkAllRead |
notificationsMarkRead | string | "Okundu işaretle" | notificationsMarkRead |
notificationsClear | string | "Tümünü temizle" | notificationsClear |
notificationsEmpty | string | "Henüz bildirim yok" | notificationsEmpty |
notificationsEmptyUnread | string | "Okunmamış bildirim yok" | notificationsEmptyUnread |
notificationsUnreadCount | string | "{count} okunmamış" | notificationsUnreadCount |
notificationsNew | string | "Yeni bildirim: {title}" | notificationsNew |
cancel | string | "İptal" | Cancel button. |
commandBack | string | "Geri" | Button that returns to the parent page in the command palette. |
commandPalette | string | "Komut paleti" | Accessible name of the command palette. |
commandPlaceholder | string | "Komut ya da arama yazın…" | Search box of the command palette. |
commandRecent | string | "Son kullanılanlar" | Recently used group in the command palette. |
navigation | string | "Ana menü" | navigation |
expandSidebar | string | "Kenar çubuğunu genişlet" | expandSidebar |
collapseSidebar | string | "Kenar çubuğunu daralt" | collapseSidebar |
menu | string | "Menü" | menu |
openMenu | string | "Menüyü aç" | openMenu |
more | string | "Daha fazla" | more |
tableOfContents | string | "Bu sayfada" | Title of the table of contents. |
confirm | string | "Onayla" | Confirm button of a confirmation dialog. |
sheetHandle | string | "Panel boyutu" | Drag handle of a Sheet (screen reader). |
breadcrumb | string | "Sayfa yolu" | Screen reader name of the Breadcrumb. |
tableEmpty | string | "Kayıt yok" | Table with no rows. |
timelineEmpty | string | "Henüz kayıt yok" | Timeline with no entries. |
timelineDone | string | "Tamamlandı" | Screen reader text of a Timeline entry with the "done" status. |
timelineActive | string | "Şu anki adım" | Screen reader text of a Timeline entry with the "active" status. |
timelinePending | string | "Bekliyor" | Screen reader text of a Timeline entry with the "pending" status. |
timelineShowMore | string | "{count} kayıt daha göster" | Timeline button revealing hidden entries; {count} is replaced. |
timelineGroupCount | string | "{count} kayıt" | Entry count in a collapsible Timeline group heading; {count} is replaced. |
tourNext | string | "İleri" | Tour next button. |
tourBack | string | "Geri" | Tour back button. |
tourDone | string | "Bitir" | Tour button on the last step. |
tourSkip | string | "Geç" | Tour button in place of Back on the first step. |
tourClose | string | "Turu kapat" | Tour close (×) button. |
colorNames | ColorNameMessages | Names of the built-in ColorPicker swatches. |
The user's color scheme preference: "system" follows the operating system.
SetColorSchemeOptions
interfacesetColorScheme options.
| Name | Type | Description |
|---|---|---|
transition? | ThemeTransition | Animation for this change; overrides the provider's transition. |
origin? | ThemeTransitionOrigin | Start point of spreading animations (ripple, circle): an onPress event or window coordinates. Defaults to the last touched spot. |
Density
typeDensity: proportionally shrinks or grows all spacing and heights (same factors as UIProvider density on web). Touch targets never go below 44 pixels.
Icon component: any component taking size and color (your own icons or an icon library).
Icons by name: drawing data (IconData, drawn with the library's native drawing view) or a component.
PreferenceStorage
interfaceWhere 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.
| Name | Type | Description |
|---|---|---|
get | (key: string): unknown | Reads 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): unknown | Stores the value. |
UIProviderProps
interfaceUIProvider props.
| Name | Type | Default | Description |
|---|---|---|---|
children? | ReactNode | App. | |
theme? | ThemeInput | GeneratedTheme | Theme: 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? | ColorScheme | When given, the user preference is ignored and this scheme always applies. | |
storage? | PreferenceStorage | Where the preference is stored. See PreferenceStorage. | |
storageKey? | string | "ui-theme"` (same as web) | Storage key. |
density? | Density | "standard" | Density. See Density. |
fontFamily? | FontFamily | Font. 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? | NativeIconRegistry | The 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? | AppearanceConfig | Appearance 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? | string | License 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). |
UIContextValue
interfaceThe useUI value.
| Name | Type | Description |
|---|---|---|
colorScheme | ColorSchemePreference | The user's preference (may be "system"). |
setColorScheme | (scheme: ColorSchemePreference, options?: SetColorSchemeOptions) => void | Changes the preference and stores it (if storage was given). If the provider has transition, the change is shown with an animation. |
density | number | Density factor (standard = 1). |
space | (steps: number) => number | Spacing unit: same as the Tailwind scale on web (space(4) = 16 px × density). p-4 → space(4). |
font | (weight: FontWeightInput, italic?: boolean) => FontStyle | Font 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. |
fontFamily | FontFamily | undefined | Font family (UIProviderProps.fontFamily). |
scale | Scaler | Device scaler: scale.s(20) for sizes, scale.fs(16) for text. Refreshed when the window changes. See Scaler. |
icons | NativeIconRegistry | undefined | The app's icons. |
messages | NativeMessages | Component texts (missing ones filled with the Turkish defaults). |
locale | string | Locale for number and date formatting. |
currency | string | Currency. |
appearance | AppearanceConfig | Appearance settings (UIProviderProps.appearance); empty if not given. |
scheme | ColorScheme | Active color scheme. |
colors | ThemeColors | Colors. See ThemeColors. |
chart | readonly string[] | Ordered colors of chart series. |
code | CodeThemeColors | Code 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. |
ColorSchemeScopeProps
interfaceColorSchemeScope props.
| Name | Type | Description |
|---|---|---|
scheme | ColorScheme | Color scheme of the subtree. |
children | ReactNode | Content. |
ThemeColors
typeTheme colors; rgba() strings React Native understands. Names match the web tokens, only written in camelCase (--ui-primary-foreground → primaryForeground).
ColorScheme
typeLight or dark color scheme.
ThemeInput
interfaceTheme 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.
| Name | Type | Default | Description |
|---|---|---|---|
light? | Partial<ThemeTokens> | Light theme tokens; those not given use defaults. | |
dark? | Partial<ThemeTokens> | Dark theme tokens; those not given use defaults. | |
radius? | number | string | 10` (`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
ResolvedTheme
interfaceResolved theme: the values components read.
| Name | Type | Description |
|---|---|---|
scheme | ColorScheme | Active color scheme. |
colors | ThemeColors | Colors. See ThemeColors. |
chart | readonly string[] | Ordered colors of chart series. |
code | CodeThemeColors | Code 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.
ThemeTransitionOptions
interfaceDetailed settings of a theme transition.
| Name | Type | Default | Description |
|---|---|---|---|
type | ThemeTransitionType | Animation type. | |
duration? | number | fade` 500, `ripple` 900 (including the drop's fall), `circle` 550, `wipe` 600, `blur` 500 | Duration (milliseconds). |
easing? | string | A smooth curve chosen per type. | Easing curve: CSS syntax ("ease-out", "cubic-bezier(0.4, 0, 0.2, 1)"). |
ThemeTransition
typeA theme transition: just the type name or detailed settings.
Start point of spreading animations (ripple, circle): a touch event (the onPress event) or window coordinates.