storybook-addon-vuetify3

storybook addon for decoration style with vuetify3
31,123 4
Install
npm install storybook-addon-vuetify3
Latest Version:2.0.5
Vue:1 · 2 · 3
License:MIT
Last Updated:Aug 5, 2022
Links: GitHub  ·  npm
Maintainer: mikinovation

storybook-addon-vuetify3

Install

yarn add -D storybook-addon-vuetify3

Usage

Add storybook-addon-vuetify3 addon to .storybook/main.js

module.exports = {
  addons: [
    'storybook-addon-vuetify3'
  ]
}

Add vueitfy decorator to .storybook/preview.js

import { withVuetify } from 'storybook-addon-vuetify3/dist/decorators'

export const decorators = [
  withVuetify
]

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

/src/plugins/vuetify.js

// Styles
import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/styles'

// Vuetify
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'

export const myCustomLightTheme = {
  dark: false,
  colors: {
    background: '#FFFFFF',
    surface: '#FFFFFF',
    primary: '#123456',
    'primary-darken-1': '#3700B3',
    secondary: '#03DAC6',
    'secondary-darken-1': '#018786',
    error: '#B00020',
    info: '#2196F3',
    success: '#4CAF50',
    warning: '#FB8C00',
  }
}

export default createVuetify(
  // https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
  {
    components,
    directives,
    theme: {
      defaultTheme: 'myCustomLightTheme',
      themes: {
        myCustomLightTheme,
      }
    }
  }
)

.storybook/preview.js

import { withVuetify } from 'storybook-addon-vuetify3/dist/decorators'
import { myCustomLightTheme } from "../src/plugins/vuetify";

export const globalTypes = {
  vuetify: {
    theme: {
      defaultTheme: 'myCustomLightTheme',
      themes: {
        myCustomLightTheme
      }
    }
  }
}

export const decorators = [
  withVuetify
]

License

Licensed under the MIT License.

Related Packages

v-snackbars

Display the v-snackbar (from Vuetify) with a stack display

92,647 110
@nextgis/vuetify-notice

component to display quick message and dialog to a user

1,621 0
@web-types/vuetify

Web-types for vuetify

93,870 306
storybook-addon-description

Add description to panel

55,979 1
vuetify-crud

Vuetify CRUD module

4,404 2

Version History

Version Released License
2.0.5 MIT
2.0.4 MIT
2.0.3 MIT
2.0.1 MIT
2.0.0 MIT
Pre-releases (6)
Version Released License
2.0.0-beta.5 MIT
2.0.0-beta.4 MIT
2.0.0-beta.3 MIT
2.0.0-beta.2 MIT
2.0.0-beta.1 MIT