Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/react-webpack5

Package Overview
Dependencies
Maintainers
26
Versions
858
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/react-webpack5

Storybook for React: Develop React Component in isolation with Hot Reloading.

  • 8.0.0-beta.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-20.5%
Maintainers
26
Weekly downloads
 
Created

What is @storybook/react-webpack5?

The @storybook/react-webpack5 npm package is an addon for Storybook, a tool for developing UI components in isolation for React, which allows it to work with Webpack 5. It provides a streamlined development environment for building and testing UI components without needing to embed them in an application. It also includes features for visual testing, documentation, and showcasing components interactively.

What are @storybook/react-webpack5's main functionalities?

Developing UI components in isolation

Allows developers to create stories for their components, which are visual representations of different states of UI components.

import { storiesOf } from '@storybook/react';
import MyButton from './MyButton';

storiesOf('Button', module)
  .add('with text', () => <MyButton>Hello Button</MyButton>)
  .add('with emoji', () => <MyButton>😀 😎 👍 💯</MyButton>);

Custom Webpack configuration

Enables developers to customize the Webpack configuration used by Storybook to match the needs of their project.

module.exports = {
  stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
  addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
  webpackFinal: async (config, { configType }) => {
    // Custom Webpack configuration goes here
    return config;
  }
};

Interactive controls to manipulate component states

Provides a set of tools to create interactive controls for manipulating the props of the components, allowing for dynamic testing of different states.

import { ComponentStory, ComponentMeta } from '@storybook/react';
import MyButton from './MyButton';

export default {
  title: 'Button',
  component: MyButton,
  argTypes: { backgroundColor: { control: 'color' } },
} as ComponentMeta<typeof MyButton>;

const Template: ComponentStory<typeof MyButton> = (args) => <MyButton {...args} />;

export const Primary = Template.bind({});
Primary.args = {
  primary: true,
  label: 'Button',
};

Other packages similar to @storybook/react-webpack5

Keywords

FAQs

Package last updated on 17 Feb 2024

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc