Component library for classic-theme
💥 Proposal
- We should implement a component library for the classic theme.
- Those components would be reusable across the theme, and not coupled to a specific plugin.
- We could have a storybook for the theme
- We could do visual regression diffing using tools like Chromatic
- A user should be able to reuse such a component in custom pages
See also https://github.com/facebook/docusaurus/discussions/3064#discussioncomment-37801 => one usecase could to be give users the ability to reuse the docs sidebar on custom pages, if they want to create their own hardcoded sidebar in a custom page.
Some questions:
- Should it live in a separate package? so that all themes (including custom themes) can import it?
- Which components should be in this library?
Having the components in a separate package can give some modularity, it can promote integrating components in custom themes as you've highlighted.
In terms of components, apart from the navigation - code blocks, announcement bars
I'd love to see storybook being implemented. My question is would you scope storybook to this proposed component library only, or the whole project? I could help with this.
I'd love to see storybook being implemented. My question is would you scope storybook to this proposed component library only, or the whole project? I could help with this.
Great idea, I'd love to work on this as well but reserved for MLH it seems
I'd love to see storybook being implemented. My question is would you scope storybook to this proposed component library only, or the whole project? I could help with this.
Docusaurus core does not depend on Infima, but the classic theme does. I think we should scope this to the classic theme, as all the comps we'll make would use Infima classes. What do you think @yangshun ?
Great idea, I'd love to work on this as well but reserved for MLH it seems
We should setup some initial infra, and then we could split the work by migrating component by component, so there will be work for everybody :p
Stumbled across this as I'm looking for a way to nicely incorporate Radix UI Theme components into our Docusaurus site, since they align more with our branding elsewhere. Using the classic theme, I am able to Swizzle a few things, but certain components are limited.
As a more complete solution, I looked into the possibility of creating a new main theme using only Radix UI components, but proved a lot trickier than I thought. The classic theme does a lot of heavy lifting.
Having some kind of Storybook integration (even just for the classic theme) would help future main-theme developers to implement each necessary component. A separate modularized component library could also be useful to allow users to fork the classic theme with more extensively modified components.
Or maybe there are easier strategies I haven't thought of to achieve my goal. Happy to get any input!