This repository provides a working setup for Storybook with Vue 3 and Ionic.
Since there are no comprehensive guides available online, this project serves as a reference for integrating Storybook seamlessly with Vue 3 and Ionic components.
yarn installThis command starts a Vite-based playground to test components in isolation:
yarn devTo start Storybook and preview Ionic components in an interactive environment:
yarn storybook- Configures Vue 3 with custom elements support for Ionic (
ion-*components). - Handles SCSS imports dynamically based on the host project.
- Optimizes dependencies to include necessary Ionic packages.
- Defines global aliases and MIME types.
- Includes essential Storybook addons (
essentials,actions,a11y, etc.). - Configures Vite optimizations for Ionic compatibility.
- Defines storybook stories paths to load both
.stories.tsand.mdxfiles.
- Initializes Ionic Vue inside Storybook.
- Registers Ionic Web Components dynamically.
- Wraps all stories in an
<ion-app><ion-content></ion-content></ion-app>layout for accurate rendering. - Includes essential Ionic stylesheets (
core.css,normalize.css, etc.).
To fix/add the scrollbar on the documentation page, the following CSS is applied in storybook.scss:
#storybook-docs {
overflow: auto;
height: 100vh;
}