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

docz-plugin-storybook

v0.5.2

Published

Docz plugin that makes migrating from Storybook a breeze.

Downloads

12

Readme

docz-plugin-storybook

Docz plugin that makes migrating from Storybook a breeze.

NPM Build Status JavaScript Style Guide

Overview

This plugin allows you to take any existing Storybook project and effortlessly view all of your stories in Docz.

Why?

Storybook's pretty great. Writing "stories" at the component level is a very powerful abstraction, and it has benefitted from enormous popularity within the React community.

Storybook does, however, have some flaws. The docs generally provide a great developer experience but are not ideal for design systems targeting designers or other business stakeholders. Storybook sites also tend to look pretty boring and you can't currently use MDX, a transformative technology that makes writing documentation in addition to component demos extremely fast and concise.

This is where Docz comes in -- it's already a really popular project that allows developers to write better component docs faster.

Given the popularity of these two projects, we wanted to provide a simple bridge which allows you to use existing Storybook stories from within Docz just by installing a plugin.

Features

  • import and render existing stories in Docz
  • zero config - it just works for 99% of Storybooks
  • automatically populate Docz with all of your stories
  • simple to use Docz alongside Storybook
  • no need to replace Storybook or force devs to change their habits
  • the best of both worlds - Docz :heart: Storybook

Install

This module requires node >= 6.

npm install --save-dev docz docz-plugin-storybook

Usage

Let's start with an existing project that uses Storybook.

  1. Add docz to your project following the normal docz getting started guide. You should now have blank docz docs alongside your existing storybook docs.

  2. Add the plugin to your doczrc.js

// doczrc.js
import { storybook } from 'docz-plugin-storybook'

export default {
  plugins: [
    storybook()
  ]
}
  1. ~~Start docz and view all your existing stories that've been automatically imported -- complete with all the hot reloading and mdx goodness that makes Docz so great!~~ Once #7 is resolved, all of your stories will automatically be populated within Docz. Until then, you'll need to manually render your stories within mdx files as the next section explains.

Manual Rendering

You can render any of your stories within Docz mdx files by using the Story or Stories React components.

// button.mdx
---
name: Button
---

import { Story, Stories } from 'docz-plugin-storybook/dist/react'

## Render one Button story

<Story kind='Button' name='with text' />

## Render all Button stories

<Stories kind='Button' />

This would display all of the stories loaded from this example Storybook file:

// button-story.js
import React from 'react'
import { storiesOf } from '@storybook/react'
import Button from '../components/Button'

storiesOf('Button', module)
  .add('with text', () => (
    <Button>Hello Button</Button>
  ))
  .add('with some emoji', () => (
    <Button>
      <span role={'img'} aria-label={'so cool'}>
        😀 😎 👍 💯
      </span>
    </Button>
  ))

The source files containing your stories can exist anywhere as long as they're loaded from Storybook's main entrypoint which defaults to .storybook/config.js.

Also note that these stories are loaded and exposed automagically by the plugin! 🤯

FAQ

See #11 for a detailed FAQ, including answers to why Docz and Storybook solve two different problems, how this plugin works, and how to customize your stories further.

Status

See #12 for a detailed breakdown of the current roadmap. In short, this module is stable and works well with manual Story rendering from within Docz, but populating Docz's contents automatically, story isolation, and custom webpack configs are an active WIP.

Related

  • storybook - The old component library framework.
  • docz - The new hotness based on mdx.

License

MIT © Hydrate