Miss any of our Open RFC calls?Watch the recordings here! »

reakit-playground

0.14.5 • Public • Published

reakit-playground

NPM version

Installation

npm:

npm i reakit-playground

Yarn:

yarn add reakit-playground

Usage

import React from "react";
import ReactDOM from "react-dom";
import {
  usePlaygroundState,
  PlaygroundEditor,
  PlaygroundPreview,
} from "reakit-playground";
 
const initialCode = `import React from "react";
import { Provider, Button } from "reakit";
 
function Example() {
  return (
    <Provider>
      <Button>Button</Button>
    </Provider>
  );
}
`;
 
function App() {
  const playground = usePlaygroundState({ code: initialCode });
  return (
    <div>
      <PlaygroundPreview {...playground} />
      <PlaygroundEditor {...playground} readOnly />
    </div>
  );
}
 
ReactDOM.render(<App />, document.getElementById("root"));

License

MIT © Diego Haz

Install

npm i reakit-playground

DownloadsWeekly Downloads

205

Version

0.14.5

License

MIT

Unpacked Size

801 kB

Total Files

67

Last publish

Collaborators

  • avatar