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

Form

This component is a wrapper for all the other components in this library. This component handles the global state for the form itself.

Basic Usage

Render a <Form /> component.

import { Form } from 'react-form-package';
const myForm = (props) => (
<Form>
{/*
here comes your form
mix HTML with other
components from this
library: e.g.
<Button />
<Field />
<RadioGroup />
<Select />
*/}
</Form>
);

Props

You are able to pass components styled with css-in-js libraries, className props, or style props to have a styled form. If you want to validate your form and show error messages add the validate prop.

The <Form /> component actually renders every child within itself. This means you can create nested structures and style the form the way you need it.

Property TypeRequiredDefaultDescription
validateBoolfalse
inputElement<input className="rfp-input" />
checkboxElement<input className="rfp-checkbox" />
radioElement<input className="rfp-radio-group" />
radioContainerElement<div className="rfp-radio-group-container" />The Element that wraps the radio elements.
buttonElement<button className="rfp-button" />
selectElement<select className="rfp-select" />
textareaElement<textarea className="rfp-textarea" />
errorElement<div className="rfp-error-label" />