FormField properties
Summary
Props table
Parameter |
Type |
Default |
|---|---|---|
/ |
/ |
|
boolean | text | numeric | radio | checkbox | toggle | rater | slider | input | counter |
'text' |
|
string |
/ |
|
boolean |
/ |
|
(fieldValue: any) => boolean |
() => ˚{} |
|
JSX.Element | string |
/ |
|
string |
/ |
|
Record |
/ |
|
JSX.Element | string |
/ |
Props list
value
Type |
Default |
|---|---|
/ |
/ |
FormField input content
type
Type |
Default |
|---|---|
boolean | text | numeric | radio | checkbox | toggle | rater | slider | input | counter |
'text' |
The field type. It determines the UI component to be used to render it. Allowed types are:
boolean(rendered as a CheckBox)numeric(rendered as a Counter)text(rendered as a Input)radio(rendered as a RadioButton)checkbox(rendered as a CheckBox)toggle(rendered as a Toggle)rater(rendered as a Rater)slider(rendered as a Slider)input(rendered as a Input)counter(rendered as a Counter)
placeholder
Type |
Default |
|---|---|
string |
/ |
required
Type |
Default |
|---|---|
boolean |
/ |
If true, the field switch to error state if its value is empty
validate
Type |
Default |
|---|---|
(fieldValue: any) => boolean |
() => ˚{} |
Custom validation function called on submit
header
Type |
Default |
|---|---|
JSX.Element | string |
/ |
Form field header
headerClassName
Type |
Default |
|---|---|
string |
/ |
Custom classname applied on every header element
headerProps
Type |
Default |
|---|---|
Record |
/ |
Custom props applied on every header element (including MoBrix-ui shared props)
errorLabel
Type |
Default |
|---|---|
JSX.Element | string |
/ |
Custom error box content, displayed when FormField is in error state