Each Storybook addon is classified into two general categories, UI-based or Presets. Each type of addons features are documented here. Use this as a reference when creating your addon.
Panel addons allow you to add your own UI in Storybook's addon panel. This is the most common type of addon in the ecosystem. For example the official @storybook/actions and @storybook/a11y use this pattern.
Use this boilerplate code to add a new Panel to Storybook's UI:
Use this boilerplate code to add a new button to Storybook's Toolbar:
addon-toolbar/manager.js
โน๏ธ
The icon element used in the example loads the icons from the @storybook/components package. See here for the list of available icons that you can use.
Storybook preset addons are grouped collections of babel, webpack, and addons configurations to integrate Storybook and other technologies. For example the official preset-scss and preset-create-react-app.
Use this boilerplate code while writing your own preset addon.
.storybook/my-preset.js
โน๏ธ
Learn more about writing your own preset addon here.