Socket
Socket
Sign inDemoInstall

@storybook/react-vite

Package Overview
Dependencies
7
Maintainers
26
Versions
612
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
Weekly downloads
1.1M
increased by4.38%
Maintainers
26
Created
Weekly downloads
 

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.10

  • CLI: Fix existing version detection in upgrade - #25642, thanks @JReinhold!
  • React: Fix acorn ecma version warning - #25634, thanks @dannyhw!

Readme

Source

Storybook for React

Keywords

FAQs

Last updated on 18 Jan 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