Socket
Socket
Sign inDemoInstall

@storybook/preview-web

Package Overview
Dependencies
59
Maintainers
26
Versions
585
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @storybook/preview-web


Version published
Weekly downloads
2M
increased by4.1%
Maintainers
26
Install size
11.1 MB
Created
Weekly downloads
 

Package description

What is @storybook/preview-web?

The @storybook/preview-web package is a part of the Storybook ecosystem, which is an open-source tool for developing UI components in isolation for React, Vue, Angular, and more. It allows developers to create a development environment for showcasing components, enabling interactive testing and providing a platform for sharing and receiving feedback on UI implementations. The preview-web package specifically deals with rendering stories for the web and handling various aspects of the Storybook UI.

What are @storybook/preview-web's main functionalities?

Rendering stories

This feature allows developers to render stories within the Storybook environment. The code sample shows how to import the PreviewWeb class and initialize it with specific parameters such as storyId and viewMode.

import { PreviewWeb } from '@storybook/preview-web';
const preview = new PreviewWeb();
preview.initialize({ storyId, viewMode });

Handling URL changes

The package can respond to URL changes to update the displayed story accordingly. The code sample demonstrates how to use the onUrlChange method to handle changes in the story ID or view mode.

import { PreviewWeb } from '@storybook/preview-web';
const preview = new PreviewWeb();
preview.onUrlChange({ storyId, viewMode });

Customizing the Storybook UI

Developers can customize the Storybook UI by integrating with the addons package. The code sample illustrates how to set the preview instance in the addons registry.

import { addons } from '@storybook/addons';
import { PreviewWeb } from '@storybook/preview-web';

const preview = new PreviewWeb();
addons.setPreview(preview);

Other packages similar to @storybook/preview-web

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