setHeader
Only the fields you pass change; the rest keep their current value. The configuration belongs to your app and is reset when it closes.The button on the right.
icon is an Ionicons name such as share-outline; unknown names show an ellipsis. id comes back in useHeaderAction. Pass null to remove the button.Launch splash
While your app loads, the mobile, desktop and TV shells cover it with a splash: your app’s icon and name. By default the splash lifts once the page has loaded and received its auth token. If your app still fetches data or resolves a route after that, users see a spinner or an empty screen next. Keep the splash up until your first real screen is ready instead.main.tsx
The shell never waits forever. If
hideSplash() doesn’t arrive within 8 seconds of load, the splash lifts anyway. A load error lifts it at once. AppErrorBoundary from @cskn/ui calls hideSplash() when it shows an error screen. In shells that predate these calls, they do nothing and the splash lifts on load as before. In a browser they control the web splash from @cskn/ui, if your app uses it.Other controls
Off-shell, all of these are no-ops.
Desktop window
In the desktop shell, a mini app can run in the shell’s main window or in a window of its own. If your app hides the shell’s header and draws its own toolbar, use these to offer the window buttons the header used to carry. The @cskn/uiDesktopWindow and StackNavigator do this for you.
getWindowInfo() resolves { solo }, where solo is true when the app has a window of its own. It resolves null where there are no window controls: on phones and TVs, in a browser, and in desktop shells that predate it (after a short timeout).
windowAction(action) asks the shell to act on the window:
Outside the desktop shell,
windowAction does nothing.
Active window
Native desktop apps grey their selection and dim their toolbar when their window is not the active one. The UI kit does this for its own components. For your own styles, follow the window withonWindowFocusChange:
isWindowFocused() returns the last known state. It is always true outside the desktop shell and in desktop shells that predate it. Inside a UIProvider you can also use CSS: the kit sets data-cskn-window="inactive" on <html> while the window is in the background.
Menu bar
On macOS, the desktop shell can show a menu named after your app in the system menu bar, the way native apps list their commands.useAppMenu sets it while the component is mounted and removes it on unmount.
{ separator: true } for a divider. Change the items and the menu follows; pass null to remove it.
A shortcut listed in the menu belongs to the menu: the shell turns the key press into a menu click. Handle the command in the menu handler and don’t bind the same key in the page as well. In a browser, where there is no menu, bind it with useShortcut instead.
Without the hook, setAppMenu(items | null) sets the menu and onAppMenuAction(cb) listens for clicks; it returns an unsubscribe. Everywhere except the macOS desktop shell, these do nothing.