A modern boilerplate for building fast and robust design systems for React, Remix, Next.js, Vue, Angular or Vanilla JS applications ✨ using:
This monorepo is structured using Lerna. For more details, check out my blog post.
It's happening! 🎉
Storybook has officially confirmed a native Stencil integration, with contributions already coming from the Stencil core team.
👉 https://stencil-docs-git-cb-storybook-ionic1.vercel.app/docs/next/storybook
👉 https://www.npmjs.com/package/@stencil/storybook-plugin
We're closely following the progress and will switch to the native setup as soon as it's stable.
Optimized for Web Components: Seamlessly integrates across frameworks.
- Optimized for Web Components: Works seamlessly across frameworks
- Storybook Integration: Documents and tests UI components with dark mode support and Hot Module Replacement (HMR).
- Vite-Powered: Provides a lightning-fast development experience.
- SSR-Ready with Next.js: Full support for Server-Side Rendering (SSR) with Next.js App Router , unlike Lit.
- Fully Typed Arguments: Enhanced type safety with TypeScript.
- Design Tokens Support: Enables consistent theming with customizable tokens (DTCG).
- Accessibility-Focused: Define and validate ARIA attributes through a single
aria
prop, as Porsche and the Stencil Core do, accepting both JSON strings and objects to improve inclusivity and usability.
Stencil is the only Web Components framework that fully supports SSR with Next.js App Router. While Lit is better integrated with Storybook and Vite, it falls short due to:
❌ Limited SSR support (only for the outdated Next.js Page Router)
❌ Buggy and experimental React integration
✅ Why Stencil Wins:
- Full SSR support with Next.js App Router
- JSX support
- Optimized for modern Micro Frontends
- Cleaner Design System integration
Clone this repository:
git clone https://github.com/artursopelnik/stencil-storybook-boilerplate.git
cd stencil-storybook-boilerplate
-
Install dependencies:
npm install
-
Build packages
npm run build
-
Go to the Storybook package:
cd packages/storybook
- Run
npm run storybook.run
to monitor only the Storybook stories. - Run
npm run storybook
to also watch changes in the web components.
- Run
-
Optional to generate a new component:
cd packages/core npm run generate <sub-folder>
We welcome contributions! 🚀
- Pull requests and ⭐ stars are always appreciated.
- For major changes, please open an issue first.
- Ensure tests are updated accordingly.
📧 Email: artur.sopelnik93@gmail.com
💼 LinkedIn: @artursopelnik
MIT © Artur Sopelnik