Field
Provides a flexible container for form inputs, labels, and helper text.
import { Field, FieldParts,} from '@cerberus/react'
Usage
The Field
component helps manage the state of form fields and ensures consistent display of labels, helper texts, and error messages.
Primitives
You can utilize the primitive components to customize the field.
Component | Description |
---|---|
FieldRoot | The context provider for the Field parts |
FieldLabel | The label of the field |
FieldInput | The input of the field |
FieldTextarea | The textarea of the field |
FieldHelperText | The helper text of the field |
FieldErrorText | The error text of the field |
StartIndicator | The start indicator of the field |
StatusIndicator | The status indicator or end icon of the field |
RequiredIndicator | The required indicator of the field |
API
Props
The Field
component is an abstraction of the primitives and accepts the following props:
Name | Default | Description |
---|---|---|
label | The label to show above the field input. | |
helperText | The helper text to show below the field input. | |
secondaryHelperText | The secondary helper text to show below the field input at the end of the row. | |
errorText | The error text to show below the field input. It replaces the helperText when visible. |
The Field
component also accepts all the props of the FieldRoot
primitive props
Parts
The FieldParts
API is an Object containing the full family of components.
Name | Description |
---|---|
Root | The FieldRoot component which is the Provider for the family. |
Label | The FieldLabel component which displays the label and "required" notice. |
Input | The FieldInput component which is the input field. |
Textarea | The FieldTextarea component which is the textarea field. |
HelperText | The FieldHelperText component which displays the helper text. |
ErrorText | The FieldErrorText component which displays the error text. |
StartIndicator | The StartIndicator component which displays an indicator of your choice at the start of the field. |
StatusIndicator | The StatusIndicator component which displays an indicator of your choice at the end of the field. |
RequiredIndicator | The RequiredIndicator component which displays an indicator of your choice when the field is marked required . |
import { Field, FieldParts,} from '@cerberus/react'
Usage
The Field
component helps manage the state of form fields and ensures consistent display of labels, helper texts, and error messages.
Primitives
You can utilize the primitive components to customize the field.
Component | Description |
---|---|
FieldRoot | The context provider for the Field parts |
FieldLabel | The label of the field |
FieldInput | The input of the field |
FieldTextarea | The textarea of the field |
FieldHelperText | The helper text of the field |
FieldErrorText | The error text of the field |
StartIndicator | The start indicator of the field |
StatusIndicator | The status indicator or end icon of the field |
RequiredIndicator | The required indicator of the field |
API
Props
The Field
component is an abstraction of the primitives and accepts the following props:
Name | Default | Description |
---|---|---|
label | The label to show above the field input. | |
helperText | The helper text to show below the field input. | |
secondaryHelperText | The secondary helper text to show below the field input at the end of the row. | |
errorText | The error text to show below the field input. It replaces the helperText when visible. |
The Field
component also accepts all the props of the FieldRoot
primitive props
Parts
The FieldParts
API is an Object containing the full family of components.
Name | Description |
---|---|
Root | The FieldRoot component which is the Provider for the family. |
Label | The FieldLabel component which displays the label and "required" notice. |
Input | The FieldInput component which is the input field. |
Textarea | The FieldTextarea component which is the textarea field. |
HelperText | The FieldHelperText component which displays the helper text. |
ErrorText | The FieldErrorText component which displays the error text. |
StartIndicator | The StartIndicator component which displays an indicator of your choice at the start of the field. |
StatusIndicator | The StatusIndicator component which displays an indicator of your choice at the end of the field. |
RequiredIndicator | The RequiredIndicator component which displays an indicator of your choice when the field is marked required . |
import { Field, FieldParts,} from '@cerberus/react'
Usage
The Field
component helps manage the state of form fields and ensures consistent display of labels, helper texts, and error messages.
Primitives
You can utilize the primitive components to customize the field.
Component | Description |
---|---|
FieldRoot | The context provider for the Field parts |
FieldLabel | The label of the field |
FieldInput | The input of the field |
FieldTextarea | The textarea of the field |
FieldHelperText | The helper text of the field |
FieldErrorText | The error text of the field |
StartIndicator | The start indicator of the field |
StatusIndicator | The status indicator or end icon of the field |
RequiredIndicator | The required indicator of the field |
API
Props
The Field
component is an abstraction of the primitives and accepts the following props:
Name | Default | Description |
---|---|---|
label | The label to show above the field input. | |
helperText | The helper text to show below the field input. | |
secondaryHelperText | The secondary helper text to show below the field input at the end of the row. | |
errorText | The error text to show below the field input. It replaces the helperText when visible. |
The Field
component also accepts all the props of the FieldRoot
primitive props
Parts
The FieldParts
API is an Object containing the full family of components.
Name | Description |
---|---|
Root | The FieldRoot component which is the Provider for the family. |
Label | The FieldLabel component which displays the label and "required" notice. |
Input | The FieldInput component which is the input field. |
Textarea | The FieldTextarea component which is the textarea field. |
HelperText | The FieldHelperText component which displays the helper text. |
ErrorText | The FieldErrorText component which displays the error text. |
StartIndicator | The StartIndicator component which displays an indicator of your choice at the start of the field. |
StatusIndicator | The StatusIndicator component which displays an indicator of your choice at the end of the field. |
RequiredIndicator | The RequiredIndicator component which displays an indicator of your choice when the field is marked required . |
import { Field, FieldParts,} from '@cerberus/react'
Usage
The Field
component helps manage the state of form fields and ensures consistent display of labels, helper texts, and error messages.
Primitives
You can utilize the primitive components to customize the field.
Component | Description |
---|---|
FieldRoot | The context provider for the Field parts |
FieldLabel | The label of the field |
FieldInput | The input of the field |
FieldTextarea | The textarea of the field |
FieldHelperText | The helper text of the field |
FieldErrorText | The error text of the field |
StartIndicator | The start indicator of the field |
StatusIndicator | The status indicator or end icon of the field |
RequiredIndicator | The required indicator of the field |
API
Props
The Field
component is an abstraction of the primitives and accepts the following props:
Name | Default | Description |
---|---|---|
label | The label to show above the field input. | |
helperText | The helper text to show below the field input. | |
secondaryHelperText | The secondary helper text to show below the field input at the end of the row. | |
errorText | The error text to show below the field input. It replaces the helperText when visible. |
The Field
component also accepts all the props of the FieldRoot
primitive props
Parts
The FieldParts
API is an Object containing the full family of components.
Name | Description |
---|---|
Root | The FieldRoot component which is the Provider for the family. |
Label | The FieldLabel component which displays the label and "required" notice. |
Input | The FieldInput component which is the input field. |
Textarea | The FieldTextarea component which is the textarea field. |
HelperText | The FieldHelperText component which displays the helper text. |
ErrorText | The FieldErrorText component which displays the error text. |
StartIndicator | The StartIndicator component which displays an indicator of your choice at the start of the field. |
StatusIndicator | The StatusIndicator component which displays an indicator of your choice at the end of the field. |
RequiredIndicator | The RequiredIndicator component which displays an indicator of your choice when the field is marked required . |