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

relab

v1.0.0-23

Published

Isolated React component development CLI

Downloads

792

Readme

RELAB

:atom_symbol: Minimal, Isolated React UI Development Environment

Demo

Features

  • Isolated development environment
  • Zero-configuration
  • Render any React component
  • Hot reloading
  • Fullscreen
  • No UI
  • No custom APIs required
  • Support for custom CSS and stylesheets

Install

npm install -g relab
relab src/components/Button.js --open

About

RELAB is a minimal component development and testing environment that doesn't require custom configurations or any initial setup.

RELAB helps you develop UI components in a test environment that's isolated from the rest of your codebase, encouraging the development of reusable components that are small and easy to test. Instead of relying on extra configurations, RELAB promotes the use of plain React components to develop examples and style guides for any UI component library.

Getting Started

RELAB can load any React component, but typically you'll want to create test cases to see a single component in multiple states. Suppose you have a library of UI components in a folder named /src/components. To test these components, create an examples folder that will be used for displaying test states as well as serving as code examples.

In the example folder, create a file to demonstrate the use of a Button component.

// examples/Button.js
import React from 'react'
import Button from '../src/components/Button'

export default () => (
  <Button color='green'>
    Hello
  </Button>
)

Next, in your terminal run the following command. Be sure you've already installed any dependencies your components might need using npm install.

relab examples/Button.js --open

The --open flag will automatically open the development environment in your default browser.

In the browser, you should see a live reloading view of your component.

Project Setup

To use RELAB for a particular project, you might want to add npm run scripts to make using relab easier for others, and to avoid the need to install RELAB globally.

Install RELAB as a dev dependency:

npm install --save-dev relab

In your package.json add a run script:

"scripts": {
  "relab": "relab examples/Library.js --open"
}

RELAB can now be run with the command npm run relab.

CLI Options

-p --port         Port for dev server

-o --open         Open in default browser

-s --stylesheet   Path to stylesheet to include

-c --config       Path to config file

-e --export       Export the RELAB demo to a static bundle

Components

RELAB includes several wrapper components that can be used for development.

Library

Creates a library view of multiple components with controls for cycling through each component.

import Library from 'relab/Library'

XRay

A wrapper for react-x-ray with option to toggle on an off.

import XRay from 'relab/XRay'

MIT License