Storybook Options Addon
The Options addon can be used to (re-)configure the Storybook UI at runtime.
First, install the addon
npm install -D @storybook/addon-options
Add this line to your
addons.js file (create this file inside your storybook config directory if needed).
Set options globally
Import and use the
withOptions decorator in your
;;// Option defaults:;;
Using per-story options
The options-addon accepts story parameters on the
;;// If you want to set the option for all stories in of this kind;
NOTE that you must attach
withOptions as a decorator (at the top-level) for this to work.
To install type definitions:
npm install -D @types/storybook__addon-options
Make sure you also have the type definitions installed for the following libs:
You can install them using
npm install -D @types/node @types/react, assuming you are using Typescript >2.0.