
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@storybook/api
Advanced tools
The @storybook/api package is a part of Storybook, which is an open-source tool for developing UI components in isolation for React, Vue, Angular, and more. It provides a set of APIs that allow developers to interact with Storybook's internal state and methods, enabling them to create custom addons and tools that can enhance the Storybook experience.
useStorybookApi
This hook allows you to access the Storybook API within your components or addons to interact with Storybook's state and functions, such as selecting a specific story.
import { useStorybookApi } from '@storybook/api';
const api = useStorybookApi();
api.selectStory('component-id');
useAddonState
This hook is used to persist state across the Storybook UI. It's useful for addons that need to maintain state.
import { useAddonState } from '@storybook/api';
const [state, setState] = useAddonState('your-addon-id', initialState);
useParameter
This hook allows you to retrieve the value of a parameter passed to a story, which can be used to customize the behavior of an addon.
import { useParameter } from '@storybook/api';
const parameter = useParameter('parameterName', defaultValue);
React Cosmos is a development tool that allows you to build and test reusable React components. It is similar to Storybook in that it provides an isolated environment to develop components, but it does not offer the same addon API for extending its functionality.
Docz is a documentation tool that leverages MDX to help you document your components. While it provides a way to showcase components similar to Storybook, it does not have an extensive API for creating addons or interacting with the tool's internal state.
The contents of this package have moved to @storybook/manager-api
. Please update your import.
This package will no longer be released as part of the 8.0 release of storybook.
7.0.0 (March 31, 2023)
Storybook 7.0 is here! 🎉
7.0 contains hundreds more fixes, features, and tweaks. Browse the changelogs matching 7.0.0-alpha.*
, 7.0.0-beta.*
, and 7.0.0-rc.*
for the full list of changes.
See our Migration guide to upgrade from earlier versions of Storybook.
Full announcement and proper release to the latest
npm tag coming soon. 😘
FAQs
Storybook Manager API (facade)
The npm package @storybook/api receives a total of 2,299,883 weekly downloads. As such, @storybook/api popularity was classified as popular.
We found that @storybook/api demonstrated a not healthy version release cadence and project activity because the last version was released 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.