Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

socheatsok78/storybook-addon-vuetify

Repository files navigation

⚠️⚠️ This repository is no longer maintained ⚠️⚠️

See https://github.com/mikinovation/storybook-addon-vuetify3

@socheatsok78/storybook-addon-vuetify

📓 Storybook's Vuetify 🐉 Addon

@npm license

Install

yarn add -D @socheatsok78/storybook-addon-vuetify

Usage

Add @socheatsok78/storybook-addon-vuetify addon to .storybook/main.js

module.exports = {
  addons: [
    '@socheatsok78/storybook-addon-vuetify'
  ]
}

Add vueitfy decorator to .storybook/preview.js

import { withVuetify } from '@socheatsok78/storybook-addon-vuetify/dist/decorators'

export const decorators = [
  withVuetify
]

You can add withThemeProvider to use vuetify theme settings. But make sure to add globalTypes as shown.

import { withVuetify, withThemeProvider } from '@socheatsok78/storybook-addon-vuetify/dist/decorators'

export const globalTypes = {
  theme: {
    name: 'Theme',
    description: 'Global theme for components',
    defaultValue: 'light',
    toolbar: {
      icon: 'circlehollow',
      items: ['light', 'dark']
    }
  }
}

export const decorators = [
  withThemeProvider,
  withVuetify
]

License

Licensed under the MIT License.