reakit-playground
TypeScript icon, indicating that this package has built-in type declarations

0.15.11 • 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

/reakit-playground/

    Package Sidebar

    Install

    npm i reakit-playground

    Weekly Downloads

    68

    Version

    0.15.11

    License

    MIT

    Unpacked Size

    812 kB

    Total Files

    64

    Last publish

    Collaborators

    • diegohaz