Paste assistant Assistant
Figma
Star

Form

A form groups related form elements that allow users to input information or configure options.

yarn add @twilio-paste/form - or - yarn add @twilio-paste/core
import {
  Form,
  FormSection,
  FormSectionHeading,
  FormControl
} from '@twilio-paste/core/form;
import {Input} from '@twilio-paste/core/input;
import {Label} from '@twilio-paste/core/label;

const SampleForm = () => (
 <Form maxWidth="size30">
   <FormSection>
     <FormSectionHeading variant="heading30">
       Personal information
     </FormSectionHeading>
     <FormControl>
       <Label htmlFor="first-name">First name</Label>
       <Input id="first-name" />
     </FormControl>
     <FormControl>
       <Label htmlFor="last-name">Last name</Label>
       <Input id="last-name" />
     </FormControl>
   </FormSection>
 </CheckboxGroup>
);

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
string
Default
'FORM'

maxWidth

The maximum width of the Form.

Type
| string | number | (string & {}) | (MaxWidthOptions | null)[] | { [x: string]: MaxWidthOptions; [x: number]: MaxWidthOptions }

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
string
Default
'FORM_ACTIONS'

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
string
Default
'FORM_CONTROL'

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
string
Default
'FORM_CONTROL_TWO_COLUMN'

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
string
Default
'FORM_SECTION'

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
string
Default
'FORM_SECTION_DESCRIPTION'

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
string
Default
'FORM_SECTION_HEADING'

variant

The style variant you want to render the heading with. This maps directly to the heading variant.

Type
HeadingVariants
Default
'heading40'

To help us improve this site, we use tools that set cookies. The data gathered by these tools is anonymized. If you reject the use of cookies, no analytics service will be initiated.