Label
Examples
Default
Code
1<Label forId="a-test">A test form control label</Label>
With field declaration
Required:
Optional:
Code
1<Label forId="a-test" declaration="required">A test form control label</Label>23<Label forId="a-test" declaration="optional" required={false}>A test form control label</Label>
With a different size applied
Code
1<Label forId="a-test" size="small">A test form control label</Label>23<Label forId="a-test">A test form control label</Label>45<Label forId="a-test" size="large">A test form control label</Label>
With label element hidden
Code
1<Label forId="a-test" labelHidden>A test form control label</Label>
With label context applied
Code
1<Label forId="a-test" labelContext="When typing a suggested list of options will appear, use arrow keys to operate">A test form control label</Label>
With contextual action
Code
1<Label forId="a-test" labelAction={() => {}} labelActionText="Contextual action">A test form control label</Label>