1.0.0 • Published 19 days ago

@j4jinxx/form v1.0.0

Weekly downloads
-
License
GPL
Repository
github
Last release
19 days ago

Form

Minimal Form & Input React Components.

Provides Form, Input, Textarea, Radio, Checkbox and Select component

npm bundle size npm bundle size npm download

Install

npm i @j4jinxx/form

Import

import Form, { Input, Select, Checkbox, Radio } from '@j4jinxx/form';

Form Props

NameTypeDefaultDescription
onDonefunc( ) => { }Callback fired when Form gets validated and submitted (returns form current Ref)
childrennodeForm children (input, radio, select, checkbox)

Input Props

NameTypeDefaultDescription
namestringInput field name
typestringtextInput field type
labelstringInput field label
showLabelbooltrueIf false, field label is hidden
withGroupbooltrueIf false, field margin is removed

Select Props

NameTypeDefaultDescription
namestringSelect field name
optionsarray Select field options ( { label, value }, { label, value } )
labelstringSelect field label
showLabelbooltrueIf false, field label is hidden
withGroupbooltrueIf false, field margin is removed

Checkbox Props

NameTypeDefaultDescription
namestringCheckbox field name
optionsarray Checkbox field options ( { label, value }, { label, value } )
labelstringCheckbox field label
showLabelbooltrueIf false, field label is hidden
withGroupbooltrueIf false, field margin is removed
selectedValuesarray Default Checked Options
inlinebooltrueIf true, Checkbox options shown inline

Radio Props

NameTypeDefaultDescription
namestringRadio field name
optionsarray Radio field options ( { label, value }, { label, value } )
labelstringRadio field label
showLabelbooltrueIf false, field label is hidden
withGroupbooltrueIf false, field margin is removed
selectedValueanyDefault Checked Option
inlinebooltrueIf true, Radio options shown inline