
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
storybook-version
Advanced tools
The Storybook Addon Version is used to highlight the version of a component or of a package within Storybook toolbar.
npm install storybook-version --save-dev
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'
}
}
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'
}
}
}
}
Storybook version | Addon latest supported version |
---|---|
6 | 0.1.1 |
8 | 0.1.2 |
9 | latest |
FAQs
Add package or component version to the Storybook toolbar
We found that storybook-version demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.