Initial release: dreamknob library + showcase

React + TypeScript knob/fader library with a headless interaction core
(rotary, relative-drag and track modes, wheel, keyboard, a11y), SVG
primitives, nine prebuilt skins, seven-segment display engine, and a
Vite showcase with gallery, live playground and API docs.
This commit is contained in:
Dreamodus 2026-07-12 14:26:52 -07:00
commit 60a02cb1db
46 changed files with 6186 additions and 0 deletions

View file

@ -0,0 +1,23 @@
import type * as React from 'react';
import type { KnobCoreProps } from '../core/types';
/** Props common to every prebuilt knob skin. */
export interface SkinProps extends KnobCoreProps {
/** Square canvas size in px. */
size?: number;
/** Caption drawn in the travel gap at the bottom of the knob. */
label?: string;
/** Show the numeric readout. Default varies per skin. */
showValue?: boolean;
/** Unit suffix for the readout, e.g. "dB", "Hz", "%". */
unit?: string;
/** Custom readout formatter (takes precedence over unit/decimals). */
format?: (value: number) => string;
className?: string;
style?: React.CSSProperties;
}
export const MONO_FONT =
"'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
export const UI_FONT =
"'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif";