npm install ngx-lil-gui
Add NgxLilGuiModule
to your module imports which will expose 3 components
@NgModule({
imports: [NgxLilGuiModule],
})
export class SomeModule {
}
This wraps a GUI
instance. There are 3 ways to use ngx-lil-gui
:
ngx-lil-gui
: This acts as a grouping folder with no immediate controllers underneath it.ngx-lil-gui[config]
: You can pass aNgxLilGuiConfig
object to thengx-lil-gui
component and the controllers will be built based on the config.ngx-lil-gui[object]
: Build the GUI declaratively on the template.[object]
is the object that this GUI controls.
You can nest ngx-lil-gui
and it will create a folder structure for you.
<div #divElement>
<span #spanElement></span>
</div>
<ngx-lil-gui title="Group">
<ngx-lil-gui title="DIV" [object]="divElement.style"></ngx-lil-gui>
<ngx-lil-gui title="SPAN" [object]="spanElement.style"></ngx-lil-gui>
</ngx-lil-gui>
This wraps a Controller
.
<div #divElement></div>
<ngx-lil-gui title="DIV" [object]="divElement.style">
<ngx-lil-gui-controller
property="display"
[controllerConfig]="{collection: ['block', 'flex', 'inline-flex']}"
></ngx-lil-gui-controller>
</ngx-lil-gui>
This wraps a Controller
as well. It will display a color picker.
<div #divElement></div>
<ngx-lil-gui title="DIV" [object]="divElement.style">
<ngx-lil-gui-color property="backgroundColor"></ngx-lil-gui-color>
</ngx-lil-gui>