Socket
Socket
Sign inDemoInstall

@storybook/client-api

Package Overview
Dependencies
59
Maintainers
8
Versions
1301
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @storybook/client-api

Storybook Client API


Version published
Weekly downloads
2.8M
increased by3.26%
Maintainers
8
Install size
13.0 MB
Created
Weekly downloads
ย 

Package description

What is @storybook/client-api?

The @storybook/client-api package is part of the Storybook ecosystem, which is a tool for developing UI components in isolation for React, Vue, Angular, and more. This package provides APIs to configure and manage stories in the Storybook environment programmatically. It allows developers to add stories, decorators, and parameters, and to interact with Storybook's client-side application.

What are @storybook/client-api's main functionalities?

Add stories

This feature allows developers to add stories to Storybook. Each story represents a single visual state of a component. The 'storiesOf' function is used to define a new set of stories.

import { storiesOf } from '@storybook/client-api';

storiesOf('Button', module)
  .add('with text', () => '<button>Click me</button>')
  .add('with emoji', () => '<button>๐Ÿ˜€ ๐Ÿ˜Ž ๐Ÿ‘ ๐Ÿ’ฏ</button>');

Add decorators

Decorators are a way to provide custom rendering and add functionality to stories. The 'addDecorator' function is used to globally add decorators to all stories.

import { addDecorator } from '@storybook/client-api';
import { withKnobs } from '@storybook/addon-knobs';

addDecorator(withKnobs);

Set global parameters

Parameters are a set of static, named metadata about a story, typically used to control the behavior of Storybook's addons. The 'addParameters' function is used to set global parameters for all stories.

import { addParameters } from '@storybook/client-api';

addParameters({
  backgrounds: [
    { name: 'light', value: '#eeeeee', default: true },
    { name: 'dark', value: '#222222' }
  ]
});

Other packages similar to @storybook/client-api

Changelog

Source

7.6.17

  • Addon-docs: Fix Table of Contents heading leak - #23677, thanks @vmizg!
  • Core: Update ip version to fix CVE-2023-42282 - #26086, thanks @drik98!

Readme

Source

The contents of this package have moved to @storybook/preview-api. Please update your import.

This package will no longer be released as part of the 8.0 release of storybook.

Keywords

FAQs

Last updated on 20 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc