Skip to main content
A custom theme is a JSON file with a name and a map of sound definitions. Start from a built-in theme so every sound name your code imports keeps working.

Create a theme

1

Copy a built-in theme

This writes audx/themes/brand.json with every sound from mechanical. Without --from, it copies your current theme. Pass --overwrite to replace an existing file.
2

Edit the sounds

Open the file and change any sound. The file points at the theme JSON schema in node_modules, so your editor autocompletes and validates every field.
audx/themes/brand.json
See Designing sounds for how definitions work.
3

Apply it

Every installed sound is regenerated from your file, and audx.json now points at it. Run the same command again after each edit.
If your theme is missing a sound that’s installed, theme leaves that file unchanged and prints a warning.

Share a theme

A theme can be loaded from any URL that serves the JSON:
The --theme flag accepts a built-in theme name, a URL, or a path to a .json file, on every command that takes it.

Load a theme at runtime

You don’t have to generate files from a theme. loadPatch and usePatch load a theme JSON in the browser and play sounds by name:
usePatch returns an empty, silent patch with ready: false while the file loads. Its play respects <SoundProvider> and reduced motion.

Theme file format

The published schema is at https://audx.site/schemas/theme.schema.json.