className
string
The className property sets the value of the class attribute of the element.
Wrapping component for form elements. Uses the <Stack>
component for layout and spacing.
<FormControl><InputLabel htmlFor="text-input">First Name</InputLabel><TextInputid="text-input"name="text-input"type="text"/></FormControl>
Additional context can be provided alongside a form field using the <FormControlMessage>
component.
e.g. 978-0-12-409542-7
<FormControl><InputLabel htmlFor="isbn">ISBN</InputLabel><TextInputid="isbn"name="isbn"type="text"/><FormControlMessage>e.g. 978-0-12-409542-7</FormControlMessage></FormControl>
The <FormControlError>
component allows an error with the field to be communicated to the user.
<FormControl><InputLabel htmlFor="email"></InputLabel><TextInputaria-describedby="error"defaultValue="invalid-email-address"id="email"invalidname="email"type="email"/><FormControlError id="error">Please provide a valid email address</FormControlError></FormControl>
The <FormControlError>
component allows an error with the field to be communicated to the user.
<FormControl><InputLabel htmlFor="country">Country</InputLabel><Selectaria-describedby="country_error"id="country"invalid><SelectOptionid="1-1"value="1">Country 1</SelectOption><SelectOptionid="1-2"value="2">Country 2</SelectOption></Select><FormControlError id="country_error">Please provide a valid country</FormControlError></FormControl>
The <FormControlSuccess>
component allows a success to be communicated to the user.
<FormControl><InputLabel htmlFor="city">City</InputLabel><TextInputaria-describedby="success"defaultValue="success-city"id="city"name="city"successtype="text"/><FormControlSuccess id="success">Valid city added</FormControlSuccess></FormControl>
The <FormControlButton>
component indicates a standalone form with one value to be submitted.
<form onSubmit={function noRefCheck() {}}><FormControl><InputLabel htmlFor="signup">Sign-up</InputLabel><TextInputid="signup"name="signup"onChange={function noRefCheck() {}}type="text"value=""/><FormControlButton type="submit">Submit</FormControlButton></FormControl></form>
The <FormControlButton>
component can be used with select and indicates a standalone form with one value to be submitted.
<form><FormControl><InputLabel htmlFor="subscribe">Sign-up</InputLabel><Selectaria-describedby="select-success"id="subscribe"success><SelectOptionid="1-1"value="1">Option 1</SelectOption><SelectOptionid="1-2"value="2">Option 2</SelectOption></Select><FormControlSuccess id="select-success">Subscribed successfully</FormControlSuccess><FormControlButton type="submit">Submit</FormControlButton></FormControl></form>
className
string
The className property sets the value of the class attribute of the element.
atoms
Applies permitted design system styles. See styling documentation for more.
id
string
atoms
Applies permitted design system styles. See styling documentation for more.
id
string
atoms
Applies permitted design system styles. See styling documentation for more.
block
boolean
If set to `false` component renders with `width : auto`, otherwise `width : full`.
icon
ReactNode
loading
boolean
If set to `true`, disables the button and shows a `Spinner` component in place of the child content.
variant
"text" | "icon" | "textSecondary"
iconPosition
"end" | "start"
atoms
Applies permitted design system styles. See styling documentation for more.
atoms
Applies permitted design system styles. See styling documentation for more.