Field API

API reference docs for theFieldcomponent. For examples and details on the usage of this component, visit the component demo page.

Props

PropsTypeDescriptionDefault
childrenReact.ReactNodeInput component like TextInput, Textarea.
description?React.ReactNodeProvide additional information that will aid user input._
errorMessage?React.ReactNodeMessage to show when the field is invalid._
controlId?stringSpecifies the unique identifier for the form control within the component. This ID is used to associate the input, textarea, select, button etc with its label or other descriptive elements._
isDisabled?booleanWhether the field is disabled.false
isRequired?booleanWhether user input is required on the field before form submission.false
labelReact.ReactNodeLabel for the field._
labelVisibility?'hidden' | 'visible'A label must always be provided for assistive technology, but you may hide it from sighted users when the intent can be inferred from context.'visible'
secondaryLabel?React.ReactNodeAdditional context, typically used to indicate that the field is optional._
size?'standard' | 'large'The size of the field.'standard'
counter?CounterObjPropsCounter object containing maxValue, value and isAlwaysVisible._
counter.maxValue?numberMaximum value the counter can reach._
counter.value?numberCurrent value of the counter._
counter.isAlwaysVisible?booleanWhether the counter is always visible.false