Gathering detailed insights and metrics for storybook-addon-toolbar-actions
Gathering detailed insights and metrics for storybook-addon-toolbar-actions
Gathering detailed insights and metrics for storybook-addon-toolbar-actions
Gathering detailed insights and metrics for storybook-addon-toolbar-actions
An Addon to add a button from within any react functional component to the storybook toolbar
npm install storybook-addon-toolbar-actions
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (94.75%)
JavaScript (5.25%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
6 Stars
52 Commits
2 Watchers
15 Branches
2 Contributors
Updated on Feb 10, 2023
Latest Version
0.4.8
Package Id
storybook-addon-toolbar-actions@0.4.8
Size
63.06 kB
NPM Version
6.14.13
Node Version
14.17.0
Published on
Aug 07, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
9
31
An Addon to add a button from within any react functional component to the storybook toolbar.
Note that this addon will only work with react app.
within .storybook/main.js
:
1module.exports = { 2 addons: ['storybook-addon-toolbar-actions/register'], 3};
within any functional component:
To add icon:
1import { useToolbarActions } from 'storybook-addon-toolbar-actions'; 2import AcUnitIcon from '@material-ui/icons/AcUnit'; 3 4export const WithIcon = () => { 5 useToolbarActions( 6 'icon-id', 7 <AcUnitIcon style={{ fill: 'currentColor' }} />, 8 () => { 9 console.log('clicked'); 10 }, 11 ); 12 return <button />; 13};
To add option list:
1import { useToolbarActions } from 'storybook-addon-toolbar-actions'; 2import AcUnitIcon from '@material-ui/icons/AcUnit'; 3 4export const WithOptions = () => { 5 const [options, setOptions] = useState<ToolbarActionOption[]>([ 6 { key: 'name', value: 'val' }, 7 { key: 'name2', value: 'val' }, 8 ]); 9 10 useToolbarActions( 11 'icon-id', 12 <AcUnitIcon style={{ fill: 'currentColor' }} />, 13 { 14 options, 15 onClick:(options, option) => { 16 setOptions(options); 17 console.log(option); 18 }, 19 }, 20 ); 21 return <button />; 22};
Will activate the storybook IconButton indicator.
If set a dropdown list will be open under the button:
Will close the option dropdown list when option clicked.
When multiChoice set to
true
thecloseOptionListOnClick
option has no effect.
Use this option to sort and group button in their container, when set the Separator
will be added between button.
The value of this option will be used for knob:
1setToKnob: 'locale'; 2// will be knob-locale=value
The Value of the knob set as follow:
Icon Button:
Required to set active
to true
/false
, if stateKnobValues
not set the true
/false
will be the value of knob.
When stateKnobValues
set, the value of stateKnobValues.active
or stateKnobValues.inactive
will be used depending on the active
state.
Single choice option:
When options
provided and multiChoice
not set, the value of selected option will be set to knob.
Multi choice option:
When options
provided and multiChoice
set to true
, an array of selected option will be set to knob.
When stateKnobValues
set, the value of stateKnobValues.active
or stateKnobValues.inactive
will be used depending on the active
state.
When set to true
user can select multiple option.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/27 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
69 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More