QueryClientProvider.
UIProvider:
- merges your theme overrides with the defaults and publishes them as
--cskn-*CSS variables, scoped to its own wrapper; - injects the component stylesheet and an optional reset;
- exposes the host kind, OS and live safe-area insets through
useUI(); - hosts the toast outlet (
useToast) and the confirm dialog (useConfirm); - starts remote-control navigation when running on a TV;
- catches crashes below it, so a render error never leaves a blank page.
Props
Token overrides. Only the fields you set change. See Theming.
Force the host kind instead of detecting it, for example
env="tv" to try TV navigation in a desktop browser.Inject a normalize layer: heading and paragraph margins removed,
font: inherit on form controls, block-level images and SVGs, button and link resets. Every rule has zero specificity (:where()), so your styles and the components always win. Pass false if your app relies on browser defaults.In the mobile shell, give system surfaces the platform look:
ActionSheet as an iOS action sheet or a Material bottom sheet, confirm() as an iOS alert or a Material 3 dialog. Web and desktop keep the kit’s neutral look either way.The design generation of native-looking surfaces (
StackNavigator, ActionSheet, confirm(), ContextMenu). classic is iOS 17–18 and Material 3; modern is iOS 26 Liquid Glass and Material 3 Expressive. A component’s own look overrides it.Use the OS’s own dialogs and menus instead of drawing them.
- Mobile shell (opt in):
ActionSheetbecomes the iOS system action sheet (Android keeps the drawn sheet),confirm()/alert()the system alert, andContextMenuthe Material menu on Android. - Desktop shell (on by default):
ContextMenuand menu buttons become the macOS or Windows menu, with separators and shortcut hints.ActionSheetbecomes a menu dropped from the control that opened it, without its title and message.confirm()/alert()become the system alert, which is a sheet on macOS. Passfalseto keep the drawn versions.
Follow the system text size (iOS Dynamic Type, Android font size) in the mobile shell. The stack, grouped lists, menus, action sheets, alerts and toasts scale their text, and
--cskn-font-scale (also useUI().fontScale) is available for your own styles. true clamps the scale to 0.85–1.6; pass { min, max } to choose.In the desktop shell on macOS and Windows, use the accent color the user picked in system settings as
primary, the way native desktop apps do. Where there is none, your theme’s primary stays. Without this option the desktop shell still uses the accent for selected rows and focus rings, and your primary keeps buttons and switches. See useSystemAccent.The root crash boundary. On for the outermost provider and off for nested ones. Pass
labels, fallback or onError to customize it, or false if you mount your own at the root. See Error handling.Write the page’s language to
<html lang>, so screen readers, spell checking and the browser’s translate offer get it right. Pass a code such as 'tr', or 'shell' to follow the shell’s language (the browser’s on the web) as it changes. Left out, <html lang> is not touched, so an app whose i18n library already writes it keeps doing so.The launch splash in a browser. Shells draw their own splash, so this one never shows inside them. The root provider always lifts a splash that
index.html put up (see Web splash). Pass true, or { title, icon, background, color }, to also put one up from React when index.html didn’t. React only shows it while the app holds the splash with preventSplashAutoHide(). Colors default to the theme’s bg and text.Web splash
In the mobile, desktop and TV shells, the shell covers your app with a splash while it loads (see Launch splash). In a browser nothing does by default. Add thecsknSplash() Vite plugin to show your app’s icon and name from the first paint, before your JavaScript bundle has loaded:
vite.config.ts
<title> and the icon from <link rel="icon">. Pass title, icon (an image URL or an emoji), background and color to override them. A color can be one value, or { light, dark }.
The root UIProvider lifts the splash by the same rule as the shells. It lifts on the first render, or on hideSplash() if you called preventSplashAutoHide(), 8 seconds at most. The plugin’s splash doesn’t show inside a shell or a frame. It also doesn’t show on a server-rendered page, whose content is already there. If your app never mounts a UIProvider, the splash removes itself after 15 seconds.
useUI
Host kind. A TV browser with no shell (webOS or Tizen loaded directly) is reported as
tv too.Live safe-area insets from the shell, in CSS px. See Safe area.
The resolved values of the props above, inherited by nested providers unless they set their own.
useUI throws outside a UIProvider.
The provider’s wrapper also carries data-cskn-env="<env>", so you can target a surface from CSS: