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

uibook

v0.6.1

Published

Tool for visual testing of React components with real media queries

Downloads

38

Readme

Uibook

Uibook is a tool for visual testing of React components. It let you quickly check both desktop and mobile view of your components with real media queries and different combinations of props.

The Key Features:

  • Responsive Testing for developers to play with real media queries
  • Live Text Editing for designers and editors to check their content
  • Installed as a Webpack Plugin, it doesn’t require any additional builder.

:triangular_flag_on_post: Check amazing Uibook example here: https://amplifr.com/uikit.

Usage

Quick Install :hatching_chick:

We’ve designed Uibook for seamless integration to your project. Install it as a webpack plugin, and you’re all set: Uibook doesn’t require any separate bundler.

webpack.config.js

const UibookPlugin = require('uibook/plugin')

module.exports = {
  …
  plugins: [
    new UibookPlugin({
      outputPath: '/uibook',
      controller: path.join(__dirname, '../src/uibook-controller.js'),
      hot: true
    })
  ],
}

Read more about installation →

Describe components in Pages :hatched_chick:

You should define two things only:

  1. The Page — simple object with test component name and cases;
  2. The Case — set of props and callbacks to the component.

button.uibook.js

import UibookCase from 'uibook/case'
import Button from '../src/button'

export default {
  component: Button,
  cases: [
    () => <UibookCase>Button</UibookCase>,
    () => <UibookCase props={{ isSmall: true }}>Small button</UibookCase>
  ]
}

Read more about configuration →

Pass Pages to the Controller :baby_chick:

As soon as you finished your first Uibook Page, you’re ready to write Uibook Controller. This is a place where all Pages included and passed to UibookStarter :sparkles:

uibook-controller.js

import UibookStarter from 'uibook/starter'
import ButtonUibook from './button.uibook'

export default UibookStarter({
  pages: {
    Button: ButtonUibook
  }
})

Read more about Controller →

Launch :rocket:

There is no need in any additional servers or webpack instances. Uibook integrates into your project, so just run your bundler and open /uibook (or your custom address — outputPath) in a browser.

More information

Live Text Editing

This mode enables contentEditable for each case, allowing managers, designers and interface editors to preview content in components.

Special thanks

Anyone is welcomed to contribute, you can check current tasks in PLAN.md. I would be glad to answer your questions about the project.