tweakpane / plugin-essentials

Essential components for Tweakpane
https://cocopon.github.io/tweakpane/plugins/#essentials
MIT License
74 stars 6 forks source link

Adding plugin inputs to a `TabPageApi` #16

Closed braebo closed 1 year ago

braebo commented 1 year ago

Is it possible to register plugins for a TabPageApi? It seems the TabPageApi is mostly identical to the FolderApi but I haven't been able to add plugin inputs to it.

cocopon commented 1 year ago

Yes. You can add an input with a registered plugin like other containers (the root pane and folders):

const pane = new Tweakpane.Pane();
pane.registerPlugin(TweakpaneEssentialsPlugin);

const t = pane.addTab({
  pages: [{title: 'foo'}, {title: 'bar'}],
});

// Add an interval input from the essentials plugin
t.pages[0].addInput({foo: {min: 0, max: 100}}, 'foo', {min: 0, max: 100});
cocopon commented 1 year ago

Feel free to reopen the issue if you have any updates.