Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@storybook/addons
Advanced tools
The @storybook/addons package is a core module for Storybook that provides the infrastructure to build and use addons, which are essentially plugins that can be used to extend Storybook's UI and behavior. Addons can be used to add new features, integrate with other tools, customize the panel within Storybook, and enhance the development workflow.
Addon Registration
This feature allows developers to register new addons with Storybook. The code sample demonstrates how to import the addons API and use it to register a custom addon.
import { addons } from '@storybook/addons';
import MyAddon from './my-addon';
addons.register('my-addon', MyAddon);
Addon Panel Creation
This feature allows developers to create new panels in the Storybook UI. The code sample shows how to add a new panel using the addons API.
import { addons, types } from '@storybook/addons';
import MyPanel from './my-panel';
addons.add('my-panel', {
type: types.PANEL,
title: 'My Panel',
render: ({ active, key }) => (
<MyPanel active={active} key={key} />
)
});
Addon Tool Registration
This feature enables the addition of tools to the Storybook toolbar. The code sample illustrates how to register a new tool that will be displayed when the view mode is set to 'story'.
import { addons, types } from '@storybook/addons';
import MyTool from './my-tool';
addons.add('my-tool', {
type: types.TOOL,
title: 'My Tool',
match: ({ viewMode }) => viewMode === 'story',
render: MyTool
});
The @storybook/api package provides a set of functions and hooks that can be used to interact with Storybook's internal state and events. It is similar to @storybook/addons in that it allows for extension and customization of Storybook, but it focuses more on the state and event management aspects.
The @storybook/components package offers a library of pre-built components that can be used within Storybook addons. While @storybook/addons provides the framework for creating and managing addons, @storybook/components provides the building blocks for the UI of those addons.
The @storybook/theming package allows for customization of Storybook's appearance through theming. It is similar to @storybook/addons in that it enhances the Storybook experience, but it specifically targets the visual style rather than functionality or UI extension.
The contents of this package have moved to @storybook/preview-api
and @storybook/manager-api
. Please update your import depending on where are using this API.
This package will no longer be released as part of the 8.0 release of storybook.
7.0.24
file-system-cache
to 2.3.0 - #23221, thanks @JReinhold!FAQs
Storybook addons store
The npm package @storybook/addons receives a total of 3,041,743 weekly downloads. As such, @storybook/addons popularity was classified as popular.
We found that @storybook/addons demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers 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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.