nightdeck-ui

A dark control-panel UI kit for dashboards, settings screens and Electron apps. Plain JavaScript and CSS, about 6 KB gzipped, no dependencies.

Try it

Everything below is live: switch tabs (also with the arrow keys), move the sliders, press the presets. Every change is written to the console.

Quick start

npm install nightdeck-ui

or straight from a CDN, no install:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nightdeck-ui@0.1/dist/nightdeck.min.css">
<script src="https://cdn.jsdelivr.net/npm/nightdeck-ui@0.1/dist/nightdeck.min.js"></script>
<div id="app"></div>
<script>
  const panel = Nightdeck.create("#app", {
    title: "Settings",
    tabs: {
      display: [
        { type: "toggle", id: "vsync", label: "vertical sync", value: true },
        { type: "slider", id: "brightness", label: "brightness", value: 60 }
      ]
    },
    onChange(id, value, all) { console.log(id, value, all); }
  });
</script>

Item types

typewhat it isvalue
toggleon/off switchtrue / false
sliderrange with min, max, step, unitnumber
selectdropdown with optionsstring
texttext field with placeholderstring
buttonfires an action event, variant: "accent" | "danger"-
meterprogress bar, turns warn colour above warn (50) and full colour at 1000-100 (display)
infolabel and value rowtext (display)
customyour own content: render(element, panel)-

Full API, theming and browser support: see the README.