Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@storybook/react-vite
Advanced tools
Storybook for React and Vite: Develop React components in isolation with Hot Reloading.
@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.
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
@storybook/react is the standard Storybook package for React projects. It uses Webpack as the default builder, which may be slower compared to Vite but is more mature and has broader plugin support.
storybook-builder-vite is another package that integrates Vite with Storybook. It is an alternative to @storybook/react-vite and offers similar performance benefits by leveraging Vite's fast build times.
See documentation for installation instructions, usage examples, APIs, and more.
FAQs
Storybook for React and Vite: Develop React components in isolation with Hot Reloading.
The npm package @storybook/react-vite receives a total of 1,246,124 weekly downloads. As such, @storybook/react-vite popularity was classified as popular.
We found that @storybook/react-vite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.