Quickstart: Create a floating control panel with lil-gui
mainTo use lil-gui, import the GUI class, instantiate it, and use the .add() method to attach properties from an object to the interface. lil-gui automatically detects the type of the property (Boolean, Function, String, or Number) and renders the appropriate controller (Checkbox, Button, Text Field, or Number Field).
import GUI from 'lil-gui';
const gui = new GUI();
const myObject = {
myBoolean: true,
myFunction: function() { ... },
myString: 'lil-gui',
myNumber: 1
};
gui.add( myObject, 'myBoolean' ); // Checkbox
gui.add( myObject, 'myFunction' ); // Button
gui.add( myObject, 'myString' ); // Text Field
gui.add( myObject, 'myNumber' ); // Number Field