react-styleguidist icon indicating copy to clipboard operation
react-styleguidist copied to clipboard

[Components] Allow for additional props on component demos (in addition to "View code" and Isolate button)

Open mogrady88 opened this issue 3 years ago • 1 comments

So im not sure if this has been brought up before. I searched the issues and didnt see anything. Im looking for a way to handle some added functionality in component demos. Right now we have the View Code option and the option to route to isolated demo.

Is there a way to add some additional info into the config that would allow us to add something under the demo along with the default actions? See below:

71A17A5C-0F0A-4A12-BA0E-A53A5ECF5D61

What im trying to accomplish is to allow for us to create an elegant way to render large components as full screen( without routing, think of a full screen modal ). I think it would be really clean to be able to add to that demo footer instead of jumbling up the demo body.

Our use case is strictly for full screen functionality but a possible config setting coupled with some sort of parameters in the declaration could be super useful:

```js {file: '../../../someDemo.js, addedButton: {label: '...svg', onClick: ()=>someFunction()} ```

mogrady88 avatar Feb 10 '22 21:02 mogrady88

Is this something that you guys would want to see? I can get a branch going and see how viable it is

mogrady88 avatar Feb 18 '22 16:02 mogrady88