Add an app
An app is a React component and an entry in the registry.
1. Write the component
Section titled “1. Write the component”Put it in apps/web/src/apps/<name>/. It receives the window it lives in and the values the
window was opened with:
import type { AppProps } from '../registry';
export function ClockApp({ windowId, params }: AppProps) { return <div className="clock">...</div>;}Build the window’s insides from Luna UI components:
MenuBar, StatusBar, Button, ListView. Use --luna-* tokens for colors, never literal
values.
Reach the person’s data through the session: useUserSession() for settings and
session.files for files. Never keep per-person state in a module-level variable.
2. Register it
Section titled “2. Register it”Add an entry to APPS in apps/web/src/apps/registry.tsx:
clock: { component: ClockApp, window: { title: 'Clock', icon: 'clock', width: 240, height: 260, persistKey: 'clock' }, launcher: [{ label: 'Clock', icon: 'clock', folder: 'Accessories' }],},Add singletonKey if only one window should ever be open, fileTypes if it opens a kind of
file, and openWith to list it in a file’s Open With menu.
3. Add its icon
Section titled “3. Add its icon”Icons are original artwork in apps/web/src/icons/. Follow the asset rules in
CONTRIBUTING.md before adding
one.
4. Test it
Section titled “4. Test it”A component test for its behavior, and a check that it appears in the Start menu. Open it in demo mode to see it in a window.