랭킹으로 돌아가기
Makes a floating panel for controllers on the web. Works as a drop-in replacement for dat.gui in most projects.
compactcreative-codingdependency-freegui
주요 지표
스타 성장
스타
1.6k
포크
66
주간 성장
—
이슈
12
5001k1.5k
2021년 10월2022년 7월2023년 5월2024년 2월2024년 12월2025년 10월2026년 7월
아티팩트npm
npm install lil-guiREADME
lil-gui
Makes a floating panel for controllers on the web. Works as a drop-in replacement for dat.gui in most projects. See Migrating for a list of breaking changes.
Homepage • Basic Demo • Examples • Guide • API • GitHub
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
// Add sliders to number fields by passing min and max
gui.add( myObject, 'myNumber', 0, 1 );
gui.add( myObject, 'myNumber', 0, 100, 2 ); // snap to even numbers
// Create dropdowns by passing an array or object of named values
gui.add( myObject, 'myNumber', [ 0, 1, 2 ] );
gui.add( myObject, 'myNumber', { Label1: 0, Label2: 1, Label3: 2 } );
// Chainable methods
gui.add( myObject, 'myProperty' )
.name( 'Custom Name' )
.onChange( value => {
console.log( value );
} );
// Create color pickers for multiple color formats
const colorFormats = {
string: '#ffffff',
int: 0xffffff,
object: { r: 1, g: 1, b: 1 },
array: [ 1, 1, 1 ]
};
gui.addColor( colorFormats, 'string' );
관련 저장소