# @react-spectre/form

> React components for Spectre.css's form elements.

Latest version **1.0.0-16** (published 2018-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @react-spectre/form
pnpm add @react-spectre/form
yarn add @react-spectre/form
bun add @react-spectre/form
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-16 |
| Published | 2018-01-13 |
| First published | 2018-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 65 |
| Author | Rubens Mariuzzo |
| Maintainers | rmariuzzo |

## Links

- npm: https://www.npmjs.com/package/@react-spectre/form
- Repository: https://github.com/react-spectre/react-spectre/tree/master/packages/form
- npm.io page: https://npm.io/package/@react-spectre/form

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0

## Recent versions

- 1.0.0-16 (latest) — 2018-01-13
- 1.0.0-15 — 2018-01-12
- 1.0.0-14 — 2018-01-12
- 1.0.0-13 — 2018-01-12
- 1.0.0-12 — 2018-01-09
- 1.0.0-11 — 2018-01-09
- 1.0.0-10 — 2018-01-09
- 1.0.0-9 — 2018-01-09
- 1.0.0-8 — 2018-01-08
- 1.0.0-7 — 2018-01-08
- 1.0.0-6 — 2018-01-05
- 1.0.0-5 — 2018-01-05
- 1.0.0-4 — 2018-01-04

## README

<div align=center>
<img src="assets/react-spectre-logo.png" width="256" height="256">

# `@react-spectre/form`
React components for Spectre.css's form.

<br><br><br>
</div>

## Installation

```shell
yarn add @react-spectre/form
```

```shell
npm install @react-spectre/form --save
```

<br><br><br>

## Usage

### Form

There are 7 components exported for form: `FormGroup`, `Input`, `TextArea`, `Select`, `Radio`, `CheckBox` and `Switch`.

```js
import { FormGroup, Input, TextArea, Select, Radio, CheckBox, Switch } from '@react-spectre/form'
```

#### FormGroup

A form group is a wrapper for form controls.

```jsx
<FormGroup label="Name">
  <Input />
</FormGroup>
```

#### Input

```jsx
<Input />              // Default type="text"
<Input type="email" />
```

#### TextArea

```jsx
<TextArea />
<TextArea rows="3" />
```

#### Select

```jsx
<Select>
  <option>Choose an option</option>
  <option>Slack</option>
  <option>Skype</option>
  <option>Hipcat</option>
</Select>

<Select multiple>
  <option>Choose an option</option>
  <option>Slack</option>
  <option>Skype</option>
  <option>Hipcat</option>
</Select>
```

#### Radio

```jsx
<FormGroup label="Genre">
  <Radio label="Male"   name="genre" defaultChecked>
  <Radio label="Female" name="genre">
</FormGroup>
```

#### CheckBox

```jsx
<FormGroup>
  <CheckBox label="Remember me">
  <CheckBox label="Remember me" defaultChecked>
</FormGroup>
```

#### Switch

```jsx
<FormGroup>
  <Switch label="Send me emails with news and tips">
  <Switch label="Send me emails with news and tips" defaultChecked>
</FormGroup>
```

<div align=center>
<br><br><br>

Made with :heart: by [Rubens Mariuzzo](https://github.com/rmariuzzo).

[MIT License](LICENSE)

</div>

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