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

@storybook/react-vite

Package Overview
Dependencies
Maintainers
11
Versions
858
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 8.4.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5M
increased by5.19%
Maintainers
11
Weekly downloads
 
Created

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

Keywords

FAQs

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