0.1.1 • Published 5 years ago

docz-knobs v0.1.1

Weekly downloads
77
License
MIT
Repository
github
Last release
5 years ago

NPM build

🎛 docz-knobs

Knobs component set to use with your docz based documents!

Docz is a great MDX based framework for documenting your libraries and projects. With this simple Knobs component it enables even more features as in renders helper knobs/switches for your component to make the demo even more rebust and accessible! is a

🛠 Install

yarn add docz-knobs

npm install --save docz-knobs

📟 Usage

Simply wrap your component in MDX file with the Knobs component.

import * as React from "react";
import Knobs from "docz-knobs";

import { Button } from "./Button";

<Knobs
  options={{
    scale: ["small", "normal", "big"],
    kind: ["primary", "secondary", "cancel", "dark", "gray"]
  }}
>
  <Button>Click me</Button>
</Knobs>;

Example Image

For complex types you need to specify available values with options prop.

License

MIT © matmalkowski