React Form Package
Edit page
IntroductionInstallationFormSimple FormButtonFieldFieldWrapperRadioGroupBasic UsagePropsSelectForm ValidationStateonFocus onChange onBlurState ManipulationCustom Error MessagesFeedback on disabled ButtonStylingDynamic FieldsDynamic Fields 2Dynamic Fields 3Bind Input FieldsBind Input Fields 2Third Party ComponentsFile UploadWhy

RadioGroup

This component has to be a child within the <Form /> component. This component must have <input /> components with the type="radio" as children. These children components must have a name prop which has to match the parents id. The id of the children will be the value of the <RadioGroup /> component when clicked.

Basic Usage

import {
Form,
RadioGroup,
} from 'react-form-package';

Render a <Form /> with a <RadioGroup /> and a <Button /> component.

Choose an option

Props

Property TypeRequiredDefaultDescription
id Stringtrue
typeStringtrueradio
requiredBoolfalsefalse
preOnChangeFunc false manipulate the state before its validated (see State Manipulation)
errorMessageStringfalsedefine your own custom error message for the input
onFocusFuncfalseget access to the state of the form when the user focus on the input
onChangeFuncfalseget access to the state of the form when the user changes the input
onBlurFuncfalseget access to the state of the form when the user blurs the input
bintToString, Arrayfalse  only needed for binding input fields. The id/ids of the input/inputs you want to manipulate
bintToAllwaysBoolfalse  only needed for binding input fields. Only needed if you want that the bindToCallback is triggered even the bound input field was already touched (blurred)
bindToCallbackFuncfalseonly needed for binding input fields. The callback to set the target's (bindTo) input value, which gets called onChange (return a single value or an array of values)