@netsells/storybook-vue-generate-arg-types
v1.2.1
Published
This package provides a single function to generate your `argType` property on your storybook stories based on the props added to your component.
Downloads
1,579
Keywords
Readme
@netsells/storybook-vue-generate-arg-types
This package provides a single function to generate your argType
property on your storybook stories based on the props added to your component.
Installation
$ yarn add -D @netsells/storybook-vue-generate-arg-types
Usage
// MyComponent.stories.js
import MyComponent from './MyComponent';
import generateArgTypes from '@netsells/storybook-vue-generate-arg-types';
export default {
// ...story config
argTypes: generateArgTypes(MyComponent),
};
If for any reason you'd like to override an arg type, you can pass an additional parameter of overrides:
// MyComponent.stories.js
import MyComponent from './MyComponent';
import generateArgTypes from '@netsells/storybook-vue-generate-arg-types';
export default {
// ...story config
argTypes: generateArgTypes(MyComponent, {
myProp: {
control: 'number',
default: 5,
},
}),
};