Socket
Socket
Sign inDemoInstall

@storybook/api

Package Overview
Dependencies
Maintainers
5
Versions
1281
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/api

Core Storybook API & Context


Version published
Weekly downloads
3.5M
decreased by-0.72%
Maintainers
5
Created
Weekly downloads
 

Package description

What is @storybook/api?

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.

What are @storybook/api's main functionalities?

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);

Other packages similar to @storybook/api

Changelog

Source

7.0.0-alpha.53 (November 24, 2022)

Bug Fixes
  • Angular: Fix "webpack_require.nmd is not a function" in v15 #19937
  • Controls: Exclude { table: { disable: true } } from panel count #19877
Maintenance
  • Core: Prebundle the preview #19718
  • Builder-vite: Build with tsup #19895
  • Components: Fix missing export #19923
Build
  • Remove the fix we added when enhanced-resolve was broken #19942
  • Fix CI which was broken by enhanced-resolve #19936
  • Drop inDevelopment from cra/default-js #19934
  • Fix execa import in get-report-message #19913

Keywords

FAQs

Package last updated on 24 Nov 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc