Builder
Builds panels with controls and containers. Binds the controls to plain objects, signals or stores.
Concepts
Install the library and its peer dependency solid-js:
npm install tweak-ui solid-jsImport the stylesheet:
import 'tweak-ui/style.css'Add a host element:
<div id="tools"></div>Mount a panel:
import { mount } from 'tweak-ui'
const camera = { fov: 60, near: 0.1, far: 1000 }
const panel = mount('#tools', (ui) => {
ui.group('Camera', (ui) => {
ui.scalar(camera, 'fov', { min: 10, max: 120, range: true })
ui.scalar(camera, 'near', { step: 0.01 })
ui.scalar(camera, 'far', { step: 10 })
})
})
// call after code outside of the panel changed the camera
panel.redraw()