Theme

Set the active theme by name. Binary Window ships a built-in dark theme; to author your own, see General — Theme.

Set the theme

Set the theme property on the root config node to a theme name. When omitted, the default (light) theme is used.

const bwin = new BinaryWindow({
  theme: 'dark',
  children: [
    /* ... */
  ],
});

If you authored a custom theme (see General — Theme), load its CSS and set the matching name:

const bwin = new BinaryWindow({
  theme: 'my-theme',
  children: [
    /* ... */
  ],
});

Toggle the theme

To switch themes at runtime, call the setTheme API on the instance. Passing an empty value reverts to the default (light) theme.

bwin.setTheme('dark'); // switch to the dark theme
bwin.setTheme('my-theme'); // switch to a custom theme
bwin.setTheme(''); // back to the default (light) theme