# react-create-variant

> Create variants of react components with predefined props

Latest version **0.0.2** (published 2018-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-create-variant
pnpm add react-create-variant
yarn add react-create-variant
bun add react-create-variant
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-03-05 |
| First published | 2018-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 463.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nils Klimm |
| Maintainers | nilsklimm |

## Links

- npm: https://www.npmjs.com/package/react-create-variant
- Repository: https://github.com/nilsklimm/react-create-variant
- Homepage: https://github.com/nilsklimm/react-create-variant#readme
- Issues: https://github.com/nilsklimm/react-create-variant/issues
- npm.io page: https://npm.io/package/react-create-variant

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.2.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.1

## Recent versions

- 0.0.2 (latest) — 2018-03-05
- 0.0.1 — 2018-03-05

## README

# React Create Variant

Create variants of a react component with predefined props.

## Installation

```shell
npm install react-create-variant
```

## Usage

```js
// Buttons.js
import React from 'react';
import { createVariant } from 'react-create-variant';

const Button = props => <button {...props} />;

export const ResetButton = createVariant(Button, {
  type: 'reset',
  className: 'btn btn-secondary',
});
export const SubmitButton = createVariant(Button, {
  type: 'submit',
  className: 'btn btn-primary',
});

// Form.js
import React from 'react';
import { ResetButton, SubmitButton } from 'react';

const Form = () => (
  <form>
    ...
    <ResetButton />
    <SubmitButton />
  </form>
);
```

---
_Source: https://npm.io/package/react-create-variant · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
