Audio controls without React
@audio-ui/core holds the logic of every audio/ui primitive with no framework in it: value math, scales, pointer, wheel and keyboard handling, and live sources. A control outside React is one controller, a native range input for accessibility, and a few lines of drawing.
When to Apply
- Audio controls for Vue, Svelte, Solid, Angular, web components or the plain DOM
- A project that has no React, or no
@audio-ui/react
- A knob or a fader as custom elements (
@audio-ui/elements)
- Writing a binding of the controllers for another framework
- Reviewing code that creates controllers, subscribes or redraws
Rule Categories by Priority
| Priority |
Category |
Impact |
Prefix |
| 1 |
Without React |
HIGH |
core- |
Quick Reference
1. Without React (HIGH)
core-one-controller - Create one controller per control, once; never on every option change
core-redraw-after-set-options - setOptions replaces everything and notifies no one: pass all options, then redraw
core-draw-from-snapshot - Draw angle, percent and text from getSnapshot(), never recomputed
core-native-range-input - A hidden <input type="range"> wired to keyDown and type
core-pointer-handler - Primary button, preventDefault, focus the input and touch-action: none before press
core-cleanup - Call the removers subscribe and attachWheel return
core-public-entries - @audio-ui/core and @audio-ui/core/<name>, never /internal
Workflow
- Install.
@audio-ui/elements: every primitive as custom elements, ready to style, typed for Vue templates (import type {} from "@audio-ui/elements/vue", then v-model) and Svelte's (import type {} from "@audio-ui/elements/svelte", then value and oninput); see core.md. Write a binding over @audio-ui/core (no dependencies) only for a control the elements do not cover: core.md has the entries, a plain DOM knob, and Vue and Svelte bindings.
- Create one controller per control, once (
core-one-controller), wire a hidden <input type="range"> to it (core-native-range-input), and draw from getSnapshot() (core-draw-from-snapshot).
- Handle the pointer the way the rules say (
core-pointer-handler) and call the removers on teardown (core-cleanup).
- Look. The
design skill has the skins and styles/dom.css for the plain DOM; sound and live data come from the web-audio skill.
- Verify. Tab to each control and use the arrow keys, then drag it fast.
How to Use
Read the rule files for the explanation and the incorrect and correct code:
rules/core-one-controller.md
rules/core-cleanup.md
Full Compiled Document
Every rule of this skill expanded in one file: AGENTS.md
1---2name: core3description: "Load this before writing any audio control, knob, fader, meter, XY pad or slider for Vue, Svelte, Solid, Angular, Lit, web components or plain JavaScript and the DOM, or in any project without React. It holds the framework-free @audio-ui/core controllers behind every audio/ui primitive (value math, log scales, pointer, wheel and keyboard handling, native range input for accessibility, live sources), every primitive as custom elements in @audio-ui/elements, the plain DOM knob and fader, and the Vue and Svelte bindings, so the control is not rewritten from scratch. Use it whenever the user names a non-React framework or says no React, even if they only ask for a rotary knob, a fader or a synth UI."4license: MIT5metadata:6 source: https://skillmd.com/skills/ouestlabs/core7 author: audio/ui8 version: "1.4.0"9---1011# Audio controls without React1213`@audio-ui/core` holds the logic of every audio/ui primitive with no framework in it: value math, scales, pointer, wheel and keyboard handling, and live sources. A control outside React is one controller, a native range input for accessibility, and a few lines of drawing.1415## When to Apply1617- Audio controls for Vue, Svelte, Solid, Angular, web components or the plain DOM18- A project that has no React, or no `@audio-ui/react`19- A knob or a fader as custom elements (`@audio-ui/elements`)20- Writing a binding of the controllers for another framework21- Reviewing code that creates controllers, subscribes or redraws2223## Rule Categories by Priority2425| Priority | Category | Impact | Prefix |26| --- | --- | --- | --- |27| 1 | Without React | HIGH | `core-` |2829## Quick Reference3031### 1. Without React (HIGH)3233- `core-one-controller` - Create one controller per control, once; never on every option change34- `core-redraw-after-set-options` - `setOptions` replaces everything and notifies no one: pass all options, then redraw35- `core-draw-from-snapshot` - Draw angle, percent and text from `getSnapshot()`, never recomputed36- `core-native-range-input` - A hidden `<input type="range">` wired to `keyDown` and `type`37- `core-pointer-handler` - Primary button, `preventDefault`, focus the input and `touch-action: none` before `press`38- `core-cleanup` - Call the removers `subscribe` and `attachWheel` return39- `core-public-entries` - `@audio-ui/core` and `@audio-ui/core/<name>`, never `/internal`4041## Workflow42431. **Install.** `@audio-ui/elements`: every primitive as custom elements, ready to style, typed for Vue templates (`import type {} from "@audio-ui/elements/vue"`, then `v-model`) and Svelte's (`import type {} from "@audio-ui/elements/svelte"`, then `value` and `oninput`); see [core.md](./core.md). Write a binding over `@audio-ui/core` (no dependencies) only for a control the elements do not cover: [core.md](./core.md) has the entries, a plain DOM knob, and Vue and Svelte bindings.442. **Create one controller per control**, once (`core-one-controller`), wire a hidden `<input type="range">` to it (`core-native-range-input`), and draw from `getSnapshot()` (`core-draw-from-snapshot`).453. **Handle the pointer the way the rules say** (`core-pointer-handler`) and call the removers on teardown (`core-cleanup`).464. **Look.** The `design` skill has the skins and `styles/dom.css` for the plain DOM; sound and live data come from the `web-audio` skill.475. **Verify.** Tab to each control and use the arrow keys, then drag it fast.4849## How to Use5051Read the rule files for the explanation and the incorrect and correct code:5253```54rules/core-one-controller.md55rules/core-cleanup.md56```5758- [core.md](./core.md): the controllers outside React, with a plain DOM knob and Vue and Svelte bindings59- Full docs: https://www.audio-ui.dev/llms.txt6061## Full Compiled Document6263Every rule of this skill expanded in one file: [AGENTS.md](./AGENTS.md)