Storybook
To work with components in a more easier way, use our preset for Storybook to style and test components in isolation.
Installation
1. Install the package as a dev dependency and apply Vueless Storybook preset to the project.
npm install -D @vueless/storybook
npx @vueless/storybook initWhich:
creates
.storybookfolder with all needed configuration in the project's root.adds commands into the project
package.jsonto run and build Storybook locally.
2. Run the Storybook ✨
npm run sb:devOther available commands:
# run Storybook in docs mode (same as seen on ui.vueless.com)
npm run sb:dev:docs
# build Storybook
npm run sb:build
# preview built Storybook locally
npm run sb:previewHide unused components in Storybook
If you don’t plan to use certain Vueless components, you can hide them from Storybook by setting the component name key to false in the specific component’s config.
For example, if you don’t plan to use UPagination and UBadge in your project, you can configure them as follows:
export default {
components: {
UPagination: false,
UBadge: false,
},
};Or, if you want to hide certain Vueless components while keeping their custom configs, set the storybook key to false in the specific component’s config.
export default {
components: {
UPagination: {
storybook: false,
...
},
UBadge: {
storybook: false,
...
},
},
};Last updated