Your First Wallpaper
A color picker, a slider, a checkbox. That’s enough to turn a static page into a wallpaper someone can make their own. Try the controls below—then build the same thing with four small files.
Make it yours
Pick a color, tune the intensity, and toggle the title. The project below starts with these same defaults.
My Wallpaper
From preview to project
Section titled “From preview to project”-
Install the two packages.
In an empty project directory, install the package and Vite with Bun:
Terminal window bun add wallpaper-enginebun add --dev vite -
Add the four files.
The property record is shared by the build and your runtime listener. Switch tabs to copy each file into the matching location:
src/properties.ts import {boolProperty,colorProperty,groupProperty,sliderProperty,} from 'wallpaper-engine/plugin';export const properties = {appearance: groupProperty({ text: 'Appearance' }),accent: colorProperty({ text: 'Accent', value: '#60a5fa' }),intensity: sliderProperty({text: 'Intensity',value: 0.5,min: 0,max: 1,fraction: true,precision: 2,}),showTitle: boolProperty({ text: 'Show title', value: true }),};vite.config.ts import { defineConfig } from 'vite';import { wallpaperEnginePlugin } from 'wallpaper-engine/plugin';import { properties } from './src/properties';export default defineConfig({plugins: [wallpaperEnginePlugin({title: 'My Wallpaper',properties,}),],});src/wallpaper.ts import type { WallpaperPropertyListenerOf } from 'wallpaper-engine';import type { properties } from './properties';import { wallpaperColorToHex } from 'wallpaper-engine/helpers';import 'wallpaper-engine';window.wallpaperPropertyListener = {applyUserProperties(values) {if (values.accent) {document.body.style.backgroundColor = wallpaperColorToHex(values.accent.value,);}if (values.intensity) {document.documentElement.style.setProperty('--intensity',String(values.intensity.value),);}if (values.showTitle) {document.body.classList.toggle('title-hidden', !values.showTitle.value);}},} satisfies WallpaperPropertyListenerOf<typeof properties>;index.html <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>My Wallpaper</title><style>body {display: grid;min-height: 100vh;margin: 0;place-items: center;background: #60a5fa;color: #111827;font: 600 2rem system-ui, sans-serif;}h1 { opacity: var(--intensity, 0.5); }.title-hidden h1 { visibility: hidden; }</style></head><body><h1>My Wallpaper</h1><script type="module" src="/src/wallpaper.ts"></script></body></html> -
Start the wallpaper.
Terminal window bun x viteOpen the printed local URL and click the WE Devtools island. The Properties tab contains the same controls you tried above.
Give it a test drive
Section titled “Give it a test drive”Change Accent to recolor the background. Move Intensity to fade the title. Toggle Show title to hide it. Then choose Reset defaults in devtools to bring everything back.
The connection is small on purpose:
properties.tsdefines the editor controls and their defaults.wallpaper.tsapplies host updates to your page.satisfies WallpaperPropertyListenerOf<typeof properties>infers the callback’s keys and value types.- The Vite plugin supplies the browser simulator during development and writes
project.jsonduring a production build.
Take it into Wallpaper Engine
Section titled “Take it into Wallpaper Engine”Stop the development server and build:
bun x vite buildYour output directory now contains index.html, bundled assets, and
project.json. The simulator stays out of production. Import that directory
into Wallpaper Engine for the final host check; the
Workshop workflow walks through the handoff.
Pick the next thing to build
Section titled “Pick the next thing to build”- Make a shape respond to sound in the audio-reactive example.
- Add track artwork and playback state with the now-playing card.
- Explore every control in Property Schemas or the typed listener guide.