Skip to content

Props reference

PropTypeDefaultDescription
usernamestring'User'Login screen username
passwordstring'forthe2000s'Login password
avatarstringbuilt-inLogin/user avatar — an XPIcon id or an image URL
languagestring'en'Initial language ('en' or 'zh'; other codes need a culture package providing i18n resources)
skipBootbooleanfalseSkip the boot screen on first load
autoLoginbooleanfalseSkip the login screen
customFileSystemobjectnullYour filesystem nodes (see Content) — applied at mount
fileSystemMode'merge' | 'replace''merge''replace' keeps only OS scaffolding; your content becomes the entire desktop
wallpapersWallpaper[][]Custom wallpapers, merged over the built-in list (custom wins by id)
defaultWallpaperstringbuilt-inInitial wallpaper — a wallpaper id or a direct image URL
culturesCulturePackage[][]Culture packages extending/overriding built-in en/zh
appsAppRegistryEntry[][]Custom applications merged over the built-in registry
onEvent(e: XPEvent) => voidSubscribe to every desktop event (see Events)
refRef<XPHandle>Imperative control handle (see Events)
devtoolsbooleanfalseMount the Scenario / event DevTools overlay (dev-time; tree-shaken out when off)
mode'fullscreen' | 'embedded''fullscreen''embedded' disables all host-page hijacking in one switch
viewportPolicy'auto' | 'scale' | 'native' | 'warn''auto' (fullscreen) / 'native' (embedded)Small-screen strategy (#215) — see Small screens & mobile
storagePrefixstring'xp_'Storage namespace — each instance is fully isolated
disableContextMenuBlockbooleanfalseAllow the browser's right-click menu
disableDevToolsBlockbooleanfalseAllow F12 / Ctrl+Shift+I/J/C
disableGlobalShortcutsbooleanfalseDisable every global-scope shortcut (Ctrl+Esc, Alt+F4, Alt+Tab, BSOD egg)
keymapRecord<string, string | null>Remap or disable individual shortcuts by id (see Keyboard shortcuts)
disableScreenSaverbooleanfalseDisable the idle screensaver
hourlyChimebooleanfalsePlay the classic 整点报时 chime on the hour (a culture package can enable it too)
idleThresholdMsnumber60000Inactivity threshold before user:idle fires

apps and cultures are reactive (#122). Adding or removing an entry after mount registers/updates it — the prop wins over a runtime registerApp/registerCulture on an id collision, and built-ins + runtime registrations are preserved. customFileSystem remains mount-time (it seeds the desktop; drive later filesystem changes through useApp().fs or the ref handle).