1.0.0-16 • Published 6 years ago

@react-spectre/form v1.0.0-16

Weekly downloads
9
License
MIT
Repository
github
Last release
6 years ago

@react-spectre/form

React components for Spectre.css's form.

Installation

yarn add @react-spectre/form
npm install @react-spectre/form --save

Usage

Form

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

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

FormGroup

A form group is a wrapper for form controls.

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

Input

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

TextArea

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

Select

<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

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

CheckBox

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

Switch

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

Made with :heart: by Rubens Mariuzzo.

MIT License

1.0.0-16

6 years ago

1.0.0-15

6 years ago

1.0.0-14

6 years ago

1.0.0-13

6 years ago

1.0.0-12

6 years ago

1.0.0-11

6 years ago

1.0.0-10

6 years ago

1.0.0-9

6 years ago

1.0.0-8

6 years ago

1.0.0-7

6 years ago

1.0.0-6

6 years ago

1.0.0-5

6 years ago

1.0.0-4

6 years ago