Tweakpane adds a small on-screen panel to adjust numbers, strings, booleans, colors, and points while monitoring values. It is dependency-free and inspired by dat.GUI.
Overview
Tweakpane is a JavaScript pane library for fine-tuning parameters and watching values change during creative coding, graphics demos, and interactive prototypes. The layout is compact with a simple visual style similar in spirit to dat.GUI, and the package ships without depending on frameworks such as React or Vue.
Bindings cover editable fields for numbers, strings, booleans, colors, and 2D/3D/4D points, plus read-only monitors for numbers, strings, and booleans. UI building blocks include folders, tabs, buttons, and separators, with theming and a plugin system for custom blades and controls.
The library targets mobile use cases as well as desktop browsers, offers TypeScript definitions, and supports importing and exporting pane state as JSON. Version 4 moved to ES modules; version 3 remains available for CommonJS consumers.
Developers embed Tweakpane in canvas, WebGL, or other browser projects when they want immediate sliders and toggles wired to live simulation or rendering code.
Key features
- Number, string, boolean, color bindings
- Point 2D/3D/4D controls
- Readonly value monitors
- Folders, tabs, buttons, separators
- Theming and plugin extensibility
- JSON import and export
- TypeScript type definitions
- No third-party framework required
Use cases
- Shader uniform tweaking in the browser
- Live graphics sketch parameters
- Debug panels for creative coding
- Monitoring simulation variables
- dat.GUI-style control migration