# @krofdrakula/prop-docs-storybook

> A tool to translate TS types to Storybook ArgTypes

Latest version **0.0.9** (published 2023-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @krofdrakula/prop-docs-storybook
pnpm add @krofdrakula/prop-docs-storybook
yarn add @krofdrakula/prop-docs-storybook
bun add @krofdrakula/prop-docs-storybook
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2023-02-16 |
| First published | 2023-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Klemen Slavič |
| Maintainers | krofdrakula |
| Keywords | typescript, types, proptypes, preact |

## Links

- npm: https://www.npmjs.com/package/@krofdrakula/prop-docs-storybook
- Homepage: https://github.com/KrofDrakula/prop-docs#readme
- Issues: https://github.com/KrofDrakula/prop-docs/issues
- npm.io page: https://npm.io/package/@krofdrakula/prop-docs-storybook

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.9 (latest) — 2023-02-16
- 0.0.8 — 2023-02-16
- 0.0.7 — 2023-02-16
- 0.0.6 — 2023-02-13
- 0.0.5 — 2023-02-09
- 0.0.4 — 2023-02-06
- 0.0.3 — 2023-02-06
- 0.0.2 — 2023-01-17
- 0.0.1 — 2023-01-17

## README

This package is part of the `@krofdrakula/prop-docs-*` ecosystem. Please visit
the monorepository for a complete guide:

https://github.com/krofdrakula/prop-docs

<!--#content-->

## Storybook

```
yarn add @krofdrakula/prop-docs-storybook
```

When provided with an extracted [`Type`](https://ts-morph.com/details/types)
this package will enable you to create an `ArgTypes` description for a specific
component.

For example, extracting a Preact component requires parsing the components using
`@krofdrakula/prop-docs-preact` and then using `convertType` to return the
correct description:

```ts
import { Project } from "ts-morph";
import { getPropsType } from "@krofdrakula/prop-docs-preact";
import { extractCSF, convertType } from "@krofdrakula/prop-docs-storybook";

const project = new Project();
// this project assumes that `components.tsx` exists as in the Preact example
const { Profile } = extractCSF(project, "components.tsx", getPropsType);
const profileArgTypes = convertType(Profile);
//    ^? {
//         name: {
//           type: { name: "string", required: true },
//           description: "Person's name"
//         },
//         image: {
//           type: { name: "string", required: true },
//           description: "Person's image URL"
//         }
//       }
```

<!--#/content-->

---
_Source: https://npm.io/package/@krofdrakula/prop-docs-storybook · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
