Skip to content

Component Properties

Tim Brayshaw edited this page Dec 26, 2016 · 1 revision

The following props can be set on the form components:

In addition, you can pass any Formsy.Mixin property. At the least, components require a name.

Other props are passed through and applied to the form control, React will render these according to it’s HTML attribute whitelist. For example a placeholder property passed to the component would be applied to the form control within the component.

disabled

  • Type: React.PropTypes.bool
  • Default: false

Disables this form component. For components that allow selecting multiple values (<RadioGroup>, <CheckboxGroup>, <Select>), it is possible to disable individual elements within that control. See the documentation for individual components for details.

Alternatively you may disable all form elements by setting the disabled prop on the parent form. See Formsy.Mixin isFormDisabled.

help

  • Type: React.PropTypes.string

Text to render for the help text, typically displayed underneath the form control. See Bootstrap forms: help text.

label

  • Type: React.PropTypes.node

Content rendered within the label tag of the component.

layout

  • Type: React.PropTypes.oneOf('horizontal', 'vertical', 'elementOnly')
  • Default: 'horizontal'

Use one of the bundled layouts.

onChange

  • Type: React.PropTypes.func

If supplied, callback signature is (name, value) where name is the name of the element, and value is it’s changed value.

validatePristine

  • Type: React.PropTypes.bool
  • Default: false

Whether to present validation notices on pristine elements.

validateOnSubmit

  • Type: React.PropTypes.bool
  • Default: false

When true, validation notices are hidden until the user attempts to submit the form.

Clone this wiki locally