1.0.0 • Published 2 months ago

st-react-forms v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
2 months ago

Scribble Tone React Forms

React form components for internal Scribble Tone usage.

Install

npm install --save st-react-forms

Use

import {TextInput} from 'st-react-forms';

...
<TextInput
  name='email'
  label='Email'
  onChange={(value)=>{console.log(value)}} />
...

Components

Input Components

  • AjaxSelectInput: Wrapper for react-select async.
  • BooleanInput: Single checkbox
  • FileInput: Raw file input
  • HiddenInput: hidden field
  • RadioOptions: Array of radio buttons
  • SelectInput: Wrapper for react-select with pre-supplied options. Use AjaxSelectInput for dynamic select/search input.
  • TextArea: Textarea input
  • TextInput: Basic text input

Error Components

  • FieldErrors: Each input already renders this and will display any errors passed into the errors prop that match the name of the input. But just in case it's needed elsewhere.
  • GenericFormErrors: Can be used to display generic error messages that don't belong to a specific input.

Template Components

  • InputList: Feed it a list of the components and it'll build the form for you. See InputList file for a commented example of expected format. Can/should supply it a with prop of your form data.

Props

Some inputs have additional options. See proptypes in those files for latest props. But here are the universal props.

  • className: Class to be included on the input
  • defaultValue: Initial value of the field
  • errors: Object of errors for the form. Input will only display errors with a key of the field's name, so no need to filter beforehand. Working on a better format for this though.
  • label: Label to be displayed above the input. No label if left empty.
  • labelClassName: Optional extra class for the label element
  • name: Name of the input field. Will be placed in the 'name' attribute if appropriate.
  • onChange: returns value of the input after changing
  • wrapperClassName: 'specify and additional class for the div that wraps the input and error'
1.0.0

2 months ago

1.0.0-rc.3

2 months ago

1.0.0-rc.4

2 months ago

1.0.0-rc.1

2 months ago

1.0.0-rc.2

2 months ago

1.0.0-rc.0

2 months ago

0.3.44

3 months ago

0.3.43

3 months ago

0.3.42

3 months ago

0.3.41

3 months ago

0.3.40

9 months ago

0.3.39

1 year ago

0.3.38

1 year ago

0.3.37

2 years ago

0.3.36

2 years ago

0.3.31

2 years ago

0.3.30

2 years ago

0.3.35

2 years ago

0.3.34

2 years ago

0.3.33

2 years ago

0.3.32

2 years ago

0.3.29

2 years ago

0.3.28

5 years ago

0.3.27

5 years ago

0.3.26

5 years ago

0.3.25

5 years ago

0.3.24

5 years ago

0.3.23

5 years ago

0.3.22

5 years ago

0.3.21

5 years ago

0.3.20

5 years ago

0.3.19

5 years ago

0.3.18

5 years ago

0.3.17

5 years ago

0.3.16

5 years ago

0.3.15

5 years ago

0.3.14

5 years ago

0.3.13

5 years ago

0.3.12

5 years ago

0.3.11

5 years ago

0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.29

6 years ago

0.2.28

6 years ago

0.2.27

6 years ago

0.2.26

6 years ago

0.2.25

6 years ago

0.2.24

6 years ago

0.2.23

6 years ago

0.2.22

6 years ago

0.2.21

6 years ago

0.2.20

6 years ago

0.2.19

6 years ago

0.2.18

6 years ago

0.2.17

6 years ago

0.2.16

6 years ago

0.2.15

6 years ago

0.2.14

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.33

7 years ago

0.1.32

7 years ago

0.1.31

7 years ago

0.1.30

7 years ago

0.1.29

7 years ago

0.1.28

7 years ago

0.1.27

7 years ago

0.1.26

7 years ago

0.1.25

7 years ago

0.1.24

7 years ago

0.1.23

7 years ago

0.1.22

7 years ago

0.1.21

7 years ago

0.1.20

7 years ago

0.1.19

7 years ago

0.1.18

7 years ago

0.1.17

7 years ago

0.1.16

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago