Skip to content

Subject: Suggestion to Provide Tweakpane as a Component #5

Description

@gaki2

Hello,
I was impressed by how you made Tweakpane available as a hook.

I wanted to suggest providing Tweakpane as a React component as well.

If Tweakpane could be used as a component, it would allow us to render Panes and Folders dynamically and write code in a more declarative way.

I believe that if Tweakpane could be used in a component form,
it would make it even more convenient and versatile for users in various situations.

This is Example code.

const INITIAL_VALUE = {
     name: "tweakPane"
     count: 10,
}

const Component = () => {
   return (
         <>
            <Pane initialValue={INITIAL_VALUE} title={'My Pane'}>
                  <Binding name="name" onChange={callback} />
                  <Folder initialValue={INITIAL_VALUE}>
                         <FolderBinding name="counter" onChange={callback} />  
                   </Folder>
                  <PaneButton title="counter" label="click" onClick={callback} />
             </Pane>
             <TestComponent />
         </>
   ) 
} 

And Here’s some sample code I’ve drafted as an initial attempt.
https://github.com/gaki2/ui_craft/blob/main/packages/core/debug/src/react/Pane.tsx

P.S. I am willing to take responsibility for carrying out this task. Thank you for creating such a great library!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions