npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sag_components

v1.0.984

Published

Storybook is a user interface development environment and playground for UI components. The tool enables developers to create interactive UI components in isolation, which helps in building and maintaining complex user interfaces.

Downloads

2,546

Readme

Introduction

Storybook is a user interface development environment and playground for UI components. The tool enables developers to create interactive UI components in isolation, which helps in building and maintaining complex user interfaces.

Getting Started

TODO: Guide users through getting your code up and running on their own system. In this section you can talk about:

  1. Installation process In Strorybook project: Use the Storybook CLI to install it in a single command. Run this inside your existing project’s root directory: npx storybook@latest init
    Storybook init command needs to be installed into a project (react project) that is already set up with a framework.

To create new Storybook project for Chromatic, first open new terminal, install chromatic package: npm install --save-dev chromatic Then create a new react Storybook probect, use one command: npx sb init Select project type: react

Publish your Storybook On the command line, publish to Chromatic’s secure CDN for the first time with the following command: npx chromatic --project-token=

  1. Software dependencies Storybook will look into your project's dependencies during its install process and provide you with the best configuration available. The installation will make the following changes to your local environment: Install the required dependencies. Setup the necessary scripts to run and build Storybook. Add the default Storybook configuration.

  2. Latest releases

  3. API references

  4. Deployment Storybook components in other applications:

Publish your Storybook: Once your Storybook is built, you can publish it to a hosting service like GitHub Pages, Netlify, or AWS S3. This will make your Storybook accessible via a URL.

Once your Storybook is published, you can install your components in other applications. You can do this by adding a dependency to your package.json file and then importing the component from your Storybook.

For example, let's say you have a component called Button in your Storybook. To install this component in another application, you would add the following to your package.json file: { "dependencies": { "@your-username/your-storybook": "1.0.0" } } Then, you can import the Button component like this: import { Button } from '@your-username/your-storybook';

Use your Storybook components in other applications: Once you've installed your Storybook components in another application, you can use them just like any other component. For example, you could use the Button component like this:

import React from 'react'; import { Button } from '@your-username/your-storybook';

function MyComponent() { return ( Click me! ); }

Build and Test

TODO: Describe and show how to build your code and run the tests.

First, build your own components in: \stories Every component must include 3 files, for example the 'Button' component: button.css - defines the style of the button Button.jsx - includes React js code that defines the button Button.stories.jsx - A *.stories.js file defines all the stories for a component. Each story has a corresponding sidebar item.

When you completed creating your component, check that everything worked by running: npm run storybook It will start Storybook locally in a new browser tab (port 6006), In sidebar item click on a story, it renders in the Canvas an isolated preview iframe. Navigate between stories by clicking on them in the sidebar. If you want to learn more: https://storybook.js.org/docs/react/get-started/browse-stories

Contribute

TODO: Explain how other users and developers can contribute to make your code better.

You can create or improve existed stories for your UI components in the src/stories directory. A story is a functional use case of a UI component. For example, if you have a button component, you might create stories for "Primary Button", "Secondary Button", "Disabled Button", etc. You can also add addons to Storybook to extend its functionality. Addons can do things like display component props, simulate different device sizes, and more. To add an addon, follow the instructions provided in the addon's documentation. Users and developers may use addons to investigate the functionality of components, get ideas what to improve, and in case of developers may try to change a code of components to make it better.