# ready-fields

> `npm i ready-fields`

Latest version **1.0.8** (published 2021-03-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install ready-fields
pnpm add ready-fields
yarn add ready-fields
bun add ready-fields
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-03-10 |
| First published | 2020-05-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 58.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | seanmclem |
| Maintainers | seanmclem |

## Links

- npm: https://www.npmjs.com/package/ready-fields
- Repository: https://github.com/Seanmclem/ready-fields
- npm.io page: https://npm.io/package/ready-fields

## Recent versions

- 1.0.8 (latest) — 2021-03-10
- 1.0.7 — 2021-03-10
- 1.0.6 — 2021-02-27
- 1.0.5 — 2021-02-27
- 1.0.4 — 2021-02-27
- 1.0.3 — 2021-02-27
- 1.0.2 — 2021-01-26
- 1.0.1 — 2021-01-26
- 0.8.13 — 2020-05-03
- 0.8.12 — 2020-05-03
- 0.8.11 — 2020-05-03
- 0.8.10 — 2020-05-03
- 0.8.9 — 2020-05-03
- 0.8.8 — 2020-05-03
- 0.8.7 — 2020-05-03
- … 7 more at https://npm.io/package/ready-fields/versions

## README

## Install

`npm i ready-fields`

<br/>

## TextInput

Takes up to 7 props; name, text, setText, and optional type, error, placeholder, label. text and setText should be useState() states.
```jsx
interface TextInputProps {
    name: string;
    label?: string;
    text: string;
    setText: any;
    type?: string; // default = 'text'
    error?: string;
    placeholder?: string;
}
```

### Usage

```jsx
import { TextInput } from 'ready-fields'

<TextInput label="Title" name="title" text={title} setText={setTitle} />
```
<br/>


## CheckboxInput
Takes 3 props; name, selected, and setSelected. selected and setSelected should be useState() states.
```jsx
interface CheckboxInputProps {
    name: string;
    selected: boolean;
    setSelected: any;
}
```

### Usage
```jsx
import { CheckboxInput } from 'ready-fields'

<CheckboxInput name="IsOriginal?" selected={isOriginal} setSelected={setIsOriginal} />
```

<br/>

## CheckboxGroupInput

Takes 3 props; items, setItems, and an optional label. items and setItems should be useState() states. Also, the items objects must each have a name and a selected value. 

```jsx
interface ItemInterface {
    name: string;
    selected: boolean;
}

interface CheckboxGroupProps {
    label?: string;
    items: Array<ItemInterface>;
    setItems: any;
}
```

### Usage
```jsx
import { CheckboxGroupInput } from 'ready-fields'

<CheckboxGroupInput items={printSizes} setItems={setPrintSizes} label="Available Sizes" />
```

<br/>

## RadioGroupInput
Takes 3 or 4 props; items, setSelectedItem, and optional setItems, and an optional label. setSelectedItem, items, and setItems should be useState() states. Also, the items objects must each have a name and a selected value. 
```jsx
interface ItemInterface {
    name: string;
    selected: boolean;
}

interface IRadioGroupInputProps {
    label?: string;
    items: Array<ItemInterface>;
    setItems?: any;
    setSelectedItem: any;
}
```

### Usage
```jsx
import { CheckboxGroupInput } from 'ready-fields'

<RadioGroupInput 
    items={printSizes}
    setItems={setPrintSizes}
    setSelectedItem={setSelectedPrintSize} 
    label="Available Sizes"
/>
```

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