Git Product home page Git Product logo

react-showroom's Introduction

react-showroom

All Contributors

React Showroom

npm version

https://react-showroom.js.org/

Document React components by declaring props definition and writing markdown.

Key Features

  • Auto generate documentations for your component props from the component's TypeScript definition.
  • Write markdown to show examples to use the component, which will become an editable playground.
  • Auto generated props control/knobs based on component props type definitions.
  • Supported languages for live examples: typescript (TSX and TS), javascript (JSX and JS), and HTML.
  • Improve collaborations: edit code/add comments on specific examples with shareable URL without any backend.
  • Ensure the components are SSR-friendly - the site can be pre-render on build time.

Built With

Inspired by

This project is largely inspired by React Styleguidist. To be honest this project was started as my plan to rewrite it to understand how it works.

The standalone editor view is inspired by Playroom.

Philosophy

The philosophy of React Showroom is that you should be continuing your existing workflow (declaring component props/writing standard markdown) and the Showroom is just an automatic side product (hopefully a valuable one) of that workflow.

This is in contrast with Storybook where it aims to be central part of your development workflow (and requires you to write examples/documentations in a special format).

We believe that compared to languages (TypeScript and markdown), libraries are generally short-lived and often less stable. Write your documentations in a more stable medium gives you more freedom and allows you to migrate to alternative tool in future.

Roadmap

Following are the ideas that I want to implement as enhancements (but I not sure if they are possible):

  • Run jest tests in the Showroom
  • Vue support

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Malcolm Kee

๐Ÿ’ป ๐Ÿ›

This project follows the all-contributors specification. Contributions of any kind welcome!

react-showroom's People

Contributors

allcontributors[bot] avatar malcolm-kee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

huygn

react-showroom's Issues

RFC: Interactions

Inspired by the upcoming StorybookJS Interaction Testing, I am thinking of introducing something similar to React Showroom.

Goals

  • Allow docs viewer to see a sequence of interactions in browser directly

Must-have

  • use testing-library as the programmatic way to run simulations.

Nice-to-have

  1. Allowing reusing code for the interaction demo and tests, following our philosophy of reusing existing dev workflow instead of reinvent one.
  2. Undo/redo the interaction steps
  3. Ability to run the interaction step-by-step

Challenges

  • Because we're using markdown instead of javascript, it is probably challenging to achieve nice-to-have 1.

Intellisense

Provide intellisense in the examples. It should be technically possible, as it is available in playroom.

  • Basic support: only our components
  • Advanced support: support for imported libraries as well

Screenshot first example as SEO image

Possible approaches

  • use puppeteer - this would probably implemented as an optional feature (as forcing user to install puppeteer with this package is a no-go), user need to install puppeteer for this and turn it on.
  • use html2canvas. However this requires user to manually run it and save the image as part of the repositories. We probably need to render a dev only panel that allows us to run this in dev server. This may be a good approach, combining with File System Access API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.