Vueless Docs
ComponentsGitHubWebsite
  • Getting Started
  • Installation
    • Quick start (Vue)
    • Quick start (Nuxt)
    • Class autocompletion
    • Minimal requirements
    • Storybook docs
  • Global customization
    • General
    • Colors
    • Design system
    • Rounding
    • Focus Outline
    • Font Size
    • Disabled Opacity
    • Dark mode
    • Custom tailwind classes
  • Component customization
    • General
    • Styling
    • Unstyled mode
    • Conditional styling
    • Extends styling from keys
    • Nested components styling
    • 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
  • Other
    • Vueless Vite Plugins
Powered by GitBook
On this page
  • Installation
  • Hiding unused components in Storybook
  1. Installation

Storybook docs

Last updated 5 days 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 package as a dev dependency and apply Vueless Storybook preset to the project.

npm install -D @vueless/storybook
npx @vueless/storybook
yarn add -D @vueless/storybook
yarn @vueless/storybook
pnpm add -D @vueless/storybook --pnpm
pnpm exec @vueless/storybook
bun add @vueless/storybook -d
bunx @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 project 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.

2. Run the 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