Vueless Docs
ComponentsGitHubWebsite
  • Installation
    • Quick start (Vue)
    • Quick start (Nuxt)
    • Class autocompletion
    • Minimal requirements
    • Storybook docs
  • Global customization
    • General
    • Colors
    • Rounding
    • Focus Outline
    • Dark mode
    • Base Classes
    • Custom tailwind classes
  • Component customization
    • General
    • Styling
    • Conditional styling
    • Extends styling from keys
    • Nested components styling
    • Classes smart merging
    • Props defaults
    • Redefining props
    • Defining custom props
    • Internationalization (i18n)
  • Creating own components
    • Vueless file structure
    • Create new component
    • Copy existing component
  • Svg Icons
    • General usage
    • Custom icons
    • Dynamic import
    • Advanced settings
  • Helpers
    • Change settings in runtime
Powered by GitBook
On this page
  • Installation
  • Hiding unused components in storybook
  1. Installation

Storybook docs

Last updated 2 months ago

If you going to debug component stylings in a more easier way you can use our preset to style and test components in isolation.

Installation

1. Install the docs package as a dev dependency.

npm install -D @vueless/storybook
yarn add -D @vueless/storybook
pnpm add -D @vueless/storybook --pnpm
bun add @vueless/storybook -d

2. Run the command to apply Vueless Storybook preset to the project.

npx @vueless/storybook

Which:

  • creates .storybook folder with all needed configuration in the project's root.

  • adds commands into the project package.json to run and build Storybook locally.

  • creates .npmrc config (for pnpm propject only).

If the .storybook folder already exists, the command will back it up by renaming it to .storybook-backup-{timestamp}. You should migrate your custom configuration (if any) and remove the backup folder manually afterward.

3. Run Storybook ✨

npm run sb:dev

Other 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:preview

Hiding unused components in storybook

If you don’t plan to use certain Vueless components, you can hide them from Storybook by setting the storybook 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:

vueless.config.{js,ts}
export default {
  component: {
    UPagination: {
      storybook: false,
    },
    UBadge: {
      storybook: false,
    },
  },
};

Storybook