docz-knobs
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (20)

    Package Sidebar

    Install

    npm i docz-knobs

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    49.6 kB

    Total Files

    10

    Last publish

    Collaborators

    • monkey3310