What is @storybook/addon-essentials?
The @storybook/addon-essentials package is a collection of essential Storybook addons that are recommended for all Storybook users. It includes a set of addons that provide a wide range of functionality, such as controls for live-editing props, actions for logging interactions, viewport customization for responsive design testing, backgrounds to alter the canvas background, toolbars to add global toolbars, and more. It simplifies the setup process by including these addons by default.
What are @storybook/addon-essentials's main functionalities?
Controls
Controls allow you to interact with your component's arguments dynamically, without needing to code. It's like a playground for your components.
"addons": ["@storybook/addon-essentials"]
Actions
Actions help you to display data received by event handlers in Storybook's UI. It's useful for debugging events.
"addons": ["@storybook/addon-essentials"]
Viewport
Viewport lets you adjust the size of the iframe to check how your stories look on different screen sizes.
"addons": ["@storybook/addon-essentials"]
Backgrounds
Backgrounds can be used to change the background color or image behind your stories. This is useful for visualizing components on different backgrounds.
"addons": ["@storybook/addon-essentials"]
Toolbars & globals
Toolbars and globals allow you to add your own toolbar items and use them to control global types and values in your stories.
"addons": ["@storybook/addon-essentials"]
Other packages similar to @storybook/addon-essentials
@storybook/addon-knobs
This package allows you to add knobs to your stories in Storybook. Similar to Controls, knobs let you edit props dynamically using a UI. However, @storybook/addon-essentials' Controls are the successor to Knobs and are recommended for new development.
@storybook/addon-actions
This package is included in @storybook/addon-essentials and can be used standalone. It allows you to log interactions and events that happen in the UI components being developed.
@storybook/addon-viewport
Also part of @storybook/addon-essentials, this standalone addon allows you to view your components in different sizes and layouts in Storybook, simulating how they would look on different devices.
@storybook/addon-backgrounds
This is another addon that is part of the essentials package. It lets you define a set of backgrounds that can be applied to the Storybook canvas, allowing you to test components in different environments.
@storybook/addon-toolbars
This addon is included in the essentials package and provides the ability to create custom toolbars in Storybook. It's useful for creating global context changes for your components.
Storybook Essentials
Storybook Essentials is a curated collection of addons to bring out the best of Storybook.
Each addon is documented and maintained by the core team and will be upgraded alongside Storybook as the platform evolves. We will also do our best to maintain framework support for all of the officially supported frameworks.
Contents
Storybook essentials includes the following addons. Addons can be disabled and re-configured as described below:
Installation
You can add Essentials to your project with:
npm install --save-dev @storybook/addon-essentials
And then add the following line to your .storybook/main.js
:
export default {
addons: ['@storybook/addon-essentials'],
};
Configuration
Essentials is "zero config." That means that comes with a recommended configuration out of the box.
If you want to reconfigure an addon, simply install that addon per that addon's installation instructions and configure it as normal. Essentials scans your project's main.js
on startup and if detects one of its addons is already configured in the addons
field, it will skip that addon's configuration entirely.
Disabling addons
You can disable any of Essential's addons using the following configuration scheme in .storybook/main.js
:
export default {
addons: [{
name: '@storybook/addon-essentials',
options: {
<addon-key>: false,
}
}]
};
Valid addon keys include: actions
, backgrounds
, controls
, docs
, viewport
, toolbars
.
8.4.0
Storybook 8.4 comes with a ton of exciting new features designed to give you the best experience developing, testing, and debugging tests in the browser!
- ▶️ Unified UI for component testing
- 5️⃣ Svelte 5 and Svelte CSF support
- ⚛️ React Native Storybook 8 release
- 🏷️ Tags-based filtering to organize your Storybook
- 🫧 Dependency cleanup to reduce install footprint
- 💯 Hundreds more improvements
<details>
<summary>List of all updates</summary>
- Addon Test: Adjust file exports to be ESM/CJS compatible - #29471, thanks @valentinpalkovic!
- Addon Test: Error when addon interactions exists - #29434, thanks @valentinpalkovic!
- Addon Test: Escape XML when converting ANSI to HTML in test errors - #29446, thanks @ghengeveld!
- Addon Test: Fix hiding stacktrace for assertion errors in test panel - #29458, thanks @ghengeveld!
- Addon Test: Improve Error Handling - #29476, thanks @valentinpalkovic!
- Addon Test: Improve postinstall script - #29479, thanks @yannbf!
- Addon Test: Improve unsupported vitest message - #29486, thanks @valentinpalkovic!
- Addon Test: Only register testing module in Vite projects - #29472, thanks @yannbf!
- Addon Test: Throttle Vitest progress updates more heavily - #29482, thanks @ghengeveld!
- Addon-docs, blocks: Prebundle dependencies - #29301, thanks @JReinhold!
- Addon-Test: Support for
@vitest/browser
v2.1.2 - #29407, thanks @strozw! - Blocks: Prebundle
es-toolkit
- #29259, thanks @JReinhold! - Builder-vite: Replace .at() call with [] in codegen - #29048, thanks @Chudesnov!
- CLI: Don't add
@storybook/addon-links
by default - #29177, thanks @tobiasdiez! - CLI: Ensure
.gitignore
updated via CLI ends with a newline - #29124, thanks @3w36zj6! - CLI: Fix
yarn
detection - #29448, thanks @ndelangen! - CLI: Migrate from
chalk
to picocolors
- #28262, thanks @43081j! - CLI: Refactor NPMProxy error parsing logic - #29459, thanks @yannbf!
- ConfigFile: Fix
export { X }
parsing - #29344, thanks @vctqs1! - Core: Add unified UI Testing Module - #29241, thanks @yannbf!
- Core: Close story status menu when selecting an item - #29455, thanks @ghengeveld!
- Core: Fix building Storybook deleting project root files - #29371, thanks @JReinhold!
- Core: Fix race condition during empty folder init - #29490, thanks @valentinpalkovic!
- Core: Make
prettier
an optional peer dependency - #29223, thanks @JReinhold! - Core: Migrate from
express
to polka
- #29230, thanks @43081j! - Core: Migrate from
qs
to picoquery
- #28315, thanks @43081j! - Core: Open 'Component tests' addon panel when clicking a story status - #29456, thanks @ghengeveld!
- Core: Remove
handlebars
usage - #29208, thanks @ndelangen! - Core: Remove dependence on
file-system-cache
- #29256, thanks @ndelangen! - Core: Replace
fs-extra
with the native APIs - #29126, thanks @ziebam! - Core: Replace
lodash
with es-toolkit
- #28981, thanks @ndelangen! - Core: Show checkmark icon in story status dropdown and update status label for component tests - #29451, thanks @ghengeveld!
- Core: Show tooltip on filter toggles to clarify their purpose - #29447, thanks @ghengeveld!
- Core: Track test provider state in sessionStorage - #29450, thanks @ghengeveld!
- Core: Upgrade
esbuild
, broadening version range - #29254, thanks @ndelangen! - Dependencies: Upgrade VTA to v3.1.0 - #29449, thanks @ghengeveld!
- Dependencies: Upgrade VTA to v3.2.0 to resolve peerDep conflict - #29461, thanks @ghengeveld!
- Interactions: Escape xml of interactions errors - #29414, thanks @kasperpeulen!
- Maintenance: Fix broken and outdated documentation links - #29412, thanks @jonniebigodes!
- Manager: Add tags property to ComponentEntry objects - #29343, thanks @Sidnioulz!
- React: Prebundle all of
renderers/react
's dependencies - #29298, thanks @ndelangen! - Svelte: Improve argTypes inference with
svelte2tsx
- support runes - #29423, thanks @JReinhold! - Test: Remove unused
util
dependency - #29310, thanks @JReinhold! - UI: Brand image css class conflict causes image to resize on hot reloads - #29129, thanks @ShreySinha02!
- UI: Fix RefIndicator to use CheckIcon instead of string - #29209, thanks @JSMike!
- UI: Simple tag filtering - #29333, thanks @shilman!
- UI: Use production-mode
react
in manager - #29197, thanks @ndelangen! - Viewport-addon: Add InitialViewportKeys type to viewport addon - #29182, thanks @hyeongrok7874!
- Vite: Add jsdoc-type-pratt-parser to
optimizeDeps
- #29179, thanks @tobiasdiez! - Vite: Cleanup and prebundle dependencies - #29302, thanks @JReinhold!
- Webpack: Fix export 'act' (imported as 'React4') was not found in 'react' errors in webpack - #29235, thanks @kasperpeulen!
</details>