One control, five shapes.
Svelte components built from one track, one thumb and one signal.
Four parts in every control
The track
Grey, as tall as the control. Its corners are a fifth of its height.
The inset
A tenth of the height, all the way round. Nothing touches the edge.
The thumb
Raised and white. It is the only part that moves.
The signal
Green means on. Nothing else on a screen is this green.
One variable sizes everything
Set --dna-h on any element. Radius, inset and type follow it.
- Height
- 40px
- Radius
- 8px
- Inset
- 4px
Written like shadcn-svelte
<div class="flex flex-col gap-5">
<Label class="justify-between">Push notifications <Switch bind:checked={push} /></Label>
<Label class="justify-between" for="digest">
Email digest
<ToggleGroup.Root id="digest" type="single" variant="segmented" bind:value={digest} aria-label="Email digest">
<ToggleGroup.Item value="off">Off</ToggleGroup.Item>
<ToggleGroup.Item value="daily">Daily</ToggleGroup.Item>
<ToggleGroup.Item value="weekly">Weekly</ToggleGroup.Item>
</ToggleGroup.Root>
</Label>
<div class="flex items-center justify-between text-sm font-medium">
Snooze for {snooze} min
<Stepper bind:value={snooze} min={5} max={120} step={5} aria-label="Snooze minutes" />
</div>
</div>The same file, running:
Snooze for 30 min
Four screens built with it
Settings
Notification preferences: switches, a digest picker, quiet hours on two steppers.
Room
A home panel: a thermostat stepper, light sliders and scenes that move them.
Booking
A stay request: a range calendar, guest steppers, extras and a form that says what it sends.
Report
A weekly usage report: stats with spark bars, a bar list, a distribution bar and a composer.