railsdevs.com
railsdevs.com copied to clipboard
Integrate Lookbook for admin components
More and more View Components have been added to the Admin::
namespace the past few weeks. I'd love to be able to preview them on their own and together as a page. This could be especially helpful for new folks to the project as they can see examples without diving into code.
A PR addressing this issue should:
- [ ] Integrate the Lookbook gem in development
- [ ] Add fully implemented previews for
Admin::ListComponent
,Admin::Tables::TableComponent
, andAdmin::Forms::ContainerComponent
- [ ] Add 2-3 individual component previews
Please don't add all the component previews in this PR. This will be a pressure test of how Lookbook works, is integrated, and what we can customize. Then we can go back and add the rest when we are sure it's the right path!
Also, I'm not interested in the experimental pages feature (yet). For now the 3 "component" previews could be under a "Pages" folder.
@joemasilotti i never integrated lookbook into a project, would you like that I take this one?
If you're up for it then go for it!
Please post updates when you can as I'm really excited about this and want to see it live. If I don't hear back in 7 days I'll reach out and see how you're doing.
@joemasilotti cool, thanks! I'll keep updated here and probably start some thread in twitter to document the process 🙌🏼
That would be amazing – please do!
@joemasilotti Small update here. I already installed the gem and documented the easiest component. Everything have been going well so far, but I needed to do a small trick with the base components of the previews that we can discuss later.
Current result:
https://user-images.githubusercontent.com/16840674/188258431-64f1c456-4a99-414a-98d4-3996f62ded0a.mov
BTW, the default route for this is /lookbook
, but I'm using /docs/components
, which one do you prefer? Or would you like to use a different one?
Nice – awesome progress! /docs/components
sounds great to me, and let's also set up a redirect from /lookbook
.
I needed to do a small trick with the base components of the previews that we can discuss later.
Feel free to post a WIP PR with a comment or GitHub review comment and I can take a look. Happy to get it started earlier if the code will trickle throughout the changes.
Closing until the redesign is live.