Form control

The FormControl component adds a label and caption for its child control. If an error message is passed it renders that message in place of the caption.

Form control usage

Input caption
Textarea caption
Checkbox caption
RadioGroup caption

Form control kinds

Input caption
Positive caption
Error caption

Overrides

Additionally, you can fully customize any part of the Form Control through the overrides prop. The Form Control consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:

Input caption

Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!

FormControl API

overrides object = {}

Label { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>*
Caption { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>*
ControlContainer { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>*

label nullable union = null

A label rendered above the input field.

One of
Node,
Object => Node

caption nullable union = null

A caption rendered below the input field.

One of
Node,
Object => Node

disabled boolean

Displays label in light gray color if true

error union = false

Error state of the input. If an error prop passed it will be rendered in place of caption as an error message.

One of
Node,
Object => Node

positive union = false

Positive state of the input. If an error prop passed it will be rendered in place of positive as an error message.

One of
Node,
Object => Node

children Node required

Node