Dot Keys
Cream plastic keys in dither, each with a worn dish where the thumb goes. The chosen one stays down; pressing another trips the latch and the one that was down springs back up with a bounce. A key can carry a lamp that lights while it's down. Underneath it's a radio group with arrow keys.
Needs: None. DOM and one small canvas.
Started from a tape recorder's keys
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| options | { value: string; label: string; hint?: string; lamp?: boolean }[] | required | The keys. A hint sits under the label; a lamp lights while its key is down. |
| label | string | required | The group's name for screen readers. |
| value | string | – | The chosen value, when you hold it. |
| defaultValue | string | – | Chosen at first. The first key by default. |
| onChange | (value: string) => void | – | Called with the new value. |
| keyWidth | number | 84 | Each key's width in px. |
| tone | string | "#ff6a2a" | The lamp's colour. |
| className | string | – | Class on the root. |
| style | CSSProperties | – | Style on the root. |