leva icon indicating copy to clipboard operation
leva copied to clipboard

API Request: A way to specify non-interactive content in a pane

Open peterjcaulfield opened this issue 3 years ago • 7 comments

Use Case: I want to be able to add things to the pane that aren't controls.

E.g a diff showing the adjusted values from the original values.

In this case the pane would be dynamically updated but the content would be non-interactive.

There is a lot of value in the pane abstraction outside of the controls:

  • the styles (the panes look great!)
  • title bar
  • folders
  • draggable behaviour

peterjcaulfield avatar Mar 02 '21 22:03 peterjcaulfield

It's interesting, this could be easily achieved via custom plugins: https://codesandbox.io/s/leva-custom-plugin-1iw37?file=/src/App.tsx:1464-1475

Your plugin could just be any react code that renders anything, really

gsimone avatar Mar 02 '21 23:03 gsimone

Great thanks for this. Will experiment with this during the week :)

peterjcaulfield avatar Mar 03 '21 00:03 peterjcaulfield

@gsimone is there a way to access the store context in a plugin?

Screenshot 2021-03-03 at 11 10 00

peterjcaulfield avatar Mar 03 '21 11:03 peterjcaulfield

Hm there should be: https://codesandbox.io/s/focused-sun-f9f34

dbismut avatar Mar 03 '21 11:03 dbismut

Ah I think the issue is the dist tags for this package. If I do npm i -S leva@latest I get 0.3.2 but I can see 0.4.4 is published. Also npm outdated doesn't show me any new versions when I'm on 0.3.2.

This export is resolved correctly with 0.4.4 👍

peterjcaulfield avatar Mar 03 '21 12:03 peterjcaulfield

Oh that's weird. We still have some work to do on the ci/cd part.

dbismut avatar Mar 03 '21 12:03 dbismut

No worries I'll hopefully be able to contribute back a bit once I get my head around the code base a bit better 😄

peterjcaulfield avatar Mar 03 '21 13:03 peterjcaulfield