New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom inputs? #170
Comments
Hey @camertron - I actually had no idea that anyone was creating custom inputs like that! As you probably know it was never a documented feature, mostly because I wasn't really 100% sure that I had the implementation right yet. As of v1.0 that won't work anymore unfortunately. But being able to add custom What kind of inputs are you looking to add (or have added in the past), out of interest? |
👀 |
Ah right, it wasn't documented, that's true 😅 I'm on the Design Eng team at GitHub working on primer/view_components. I had added an _octicons.html.erb partial to our Lookbook that rendered a select dropdown with the names of all the available Octicons. Doing so made it easy to do things like # @param leading_visual_icon [Symbol] octicon There are quite a few Octicons, so listing them all in the |
@camertron yes I'm familiar with you from my stalking on the ViewComponent repo :-) And coincidentally was just checking out your Rux repo the other day, looking forward to having a bit more of a play with that. So in this case I think that the changes in #160 should solve your problem? It's a pretty common issue for people so was definitely something I wanted to solve. I'll be putting a release out in the next couple of days will include that and a few other bits, but it's merged into |
@camertron Joel actually pointed me to the Primer ViewComponent Lookbook the other day - is that what you are working on? Very cool to see all the Primer components in there. If there is anything else I can do help out with any issues you run into while setting it all up please do just let me know and I'll do my best to help! |
😆
Oh cool!
Amazing! Yes this will help quite a bit. I would still love the option to declare a custom param, since that'll be shorter/less verbose than the technique presented in #160.
Awesome, thanks, will do 😄 |
@camertron yep definitely, custom inputs are definitely still going to happen soon. Oh and just in case you need the docs for the new Have a good weekend :-) |
Sweet thank you! Have a great weekend 😄 |
@camertron just a quick follow up on this - the recent v1.1 release includes proper support for custom param inputs (docs here) which will hopefully give you a better way to implement the icon dropdown. If you run into any difficulties just let me know but hopefully the docs will give you enough to go on. |
That's awesome news, thanks @allmarkedup! Will take a look at the docs. |
Just circling back to say custom inputs worked like a charm! I've got a custom Octicons select list working in the primer/view_components Lookbook, and it was super easy to hook up. Thanks so much! |
Great! Thanks for letting me know @camertron 😊 |
It used to be you could define a custom input by adding a partial to app/views/lookbook/previews/inputs, but that doesn't seem to work anymore for Lookbook v1.x. The docs mention custom tags, but it's unclear to me how to specify a partial or component to render. Are custom inputs still a thing?
The text was updated successfully, but these errors were encountered: