Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@storybook/preview-web
Advanced tools
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.
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);
React Cosmos is a development tool for creating reusable React components. It scans your project for components and enables you to render them in different states while developing. It is similar to Storybook in that it provides an isolated environment for components, but it focuses more on the component 'playground' aspect rather than the storytelling aspect of Storybook.
Docz leverages MDX to help you document your components with ease. It provides a similar experience to Storybook by allowing developers to write interactive documentation and examples, but it emphasizes simplicity and the use of Markdown for documentation over the more extensive plugin ecosystem and UI customization options that Storybook offers.
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.
FAQs
Unknown package
The npm package @storybook/preview-web receives a total of 1,019,308 weekly downloads. As such, @storybook/preview-web popularity was classified as popular.
We found that @storybook/preview-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 26 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.