NTP/1 theme development
Choose a theme when the goal is appearance rather than new behavior. Learn the manifest, style language and option model before distributing an NTP/1 package.
Version scope: these source-level examples target v2.0.0.alpha.14. Use the Plugin SDK for current Wasm plugin authoring.
The goal is adjustable, recoverable appearance across light/dark modes without changing launcher behavior. NTP/1 combines a manifest, NSS/1, resources, and options in a .ntp ZIP or explicitly imported development directory.
Select capabilities by outcome
| Outcome | Contract | Acceptance |
|---|---|---|
| Adjustable heading color/size | Color/Range options and NSS token/option | Immediate application and persistence |
| Narrow-window layout | Viewport, grid, finite layout | No overflow; correct hit testing at both widths |
| Runtime/tray/Splash branding | Appearance resource slots | Mode/restore/startup behavior with fallback |
| User-selected background/music | File/Files/Directory and Host grants | No unauthorized reads or authority transfer |
| New commands/pages | Outside themes | Use an admitted Sidecar/Host extension |
Read the goal and architecture guide. Themes contain no scripts; style/resource expressions cannot execute commands.
Learning route
- First theme: complete files, packaging, import, three observable options.
- Manifest and values: every field, nine types, defaults, versions.
- Control recipes: switches, sliders, segmented choices, pickers, visibility, live application.
- NSS/1 language: selectors, cascade, tokens, conditions, responsive rules, rejection.
- Layout and motion: property reference, grids, transforms, virtual metrics, keyframes.
- Resources: assets, external grants, fonts, images, media.
- Appearance/capabilities: every appearance field, platforms, startup.
- Testing/publication: directory workflow, reproducible package, rollback, evidence.
- Cookbook/troubleshooting: turn appearance goals into testable changes.
Two continuing examples
examples/themes/twilight has no external resource dependency. examples/themes/workshop demonstrates all nine option kinds, major controls, conditional visibility, a packaged background, and authorized media selection. Media starts disabled; selecting a path is not automatic authority or playback.
Both use real ThemePackageService admission and the NSS compiler. Native image/font/audio output requires target-platform evidence; the portable lab does not claim native-window validation.
Compatibility
This guide targets A14 style API 1. Theme versions are independent of 2.0.0.alpha.14. Capability names are more stable than individual Host keys, but selectors still need validation against the target launcher. Missing required capabilities reject activation; optional capabilities require fallback.
Implementation references
Check your result
Follow the first-theme tutorial and verify one option survives restart.