You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@storybook/react-vite

Package Overview
Dependencies
10
Maintainers
26
Versions
696
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/react-vite

Storybook for React and Vite: Develop React components in isolation with Hot Reloading.


Version published
Maintainers
26
Created

Package description

What is @storybook/react-vite?

@storybook/react-vite is a package that integrates Storybook with Vite for React projects. It allows developers to build and test UI components in isolation with the fast and modern build tool Vite.

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

Setup Storybook with Vite

This command initializes a new Storybook configuration in your React project using Vite as the builder. It sets up the necessary files and dependencies to get started with Storybook and Vite.

npx sb init --builder @storybook/react-vite

Writing Stories

This code demonstrates how to write a story for a Button component in a React project. It defines a default export with metadata about the component and creates a template for the story. The `Primary` story is an instance of the template with specific arguments.

import React from 'react';
import { Button } from './Button';

export default {
  title: 'Example/Button',
  component: Button,
};

const Template = (args) => <Button {...args} />;

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

Running Storybook

This command starts the Storybook development server, allowing you to view and interact with your stories in the browser. It uses Vite for fast builds and hot module replacement.

npm run storybook

Other packages similar to @storybook/react-vite

Changelog

Source

7.6.16

  • Addon Themes: Make type generic less strict - #26042, thanks @yannbf!
  • Interaction: Make sure that adding spies doesn't cause infinite loops with self referencing args #26019, thanks @kasperpeulen!

Readme

Source

Storybook for React

Keywords

FAQs

Package last updated on 15 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc