0.1.2 • Published 1 year ago
storybook-version v0.1.2
Storybook Addon Version
The Storybook Addon Version is used to highlight the version of a component or of a package within Storybook toolbar.
Installation
npm install storybook-version --save-devBasic Setup
Add the following code in the main.js of your Storybook configuration:
module.exports = {
addons: ['storybook-version'],
};Set the parameters of your story with the key value version in order to provide the necessary information to be displayed.
Configuration
| Property | Required | Type of Value | Description | Example |
|---|---|---|---|---|
| major | ✔ | string | Major version | '1' |
| minor | ✔ | string | Minor version | '2' |
| patch | ✔ | string | Patch version | '3' |
| postfix | string | Postifx version extra data | 'beta.1' | |
| style | object of keys string and values string | Extra css properties to overwrite default style of the Version | '{ 'color' : 'red', 'border-width': '2px' }' |
Implementation
export const parameters = {
version: {
major: '1',
minor: '2',
patch: '3'
}
}Story Setup Example
Add the version parameter in the default Story configuration:
import React from 'react'
export default {
title: 'Component Button',
parameters: {
version: {
major: '4',
minor: '2',
patch: '0',
postfix: 'rc3',
style: {
color: 'red',
'font-weight': '900',
'font-size': '24px'
}
}
}
}0.1.2
1 year ago
0.1.2--canary.7.edbd40b.0
1 year ago
0.1.1-canary.3.42f9ede.0
3 years ago
0.1.1
3 years ago
0.1.0
4 years ago
0.1.0-canary.1.4b933cb.0
4 years ago
0.1.0-canary.1.a79e65c.0
4 years ago
0.1.0-canary.1.124627a.0
4 years ago
0.1.0-canary.1.de96151.0
4 years ago
0.0.6-canary.1.6aebcc5.0
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.1
4 years ago