Components/Forms/Form Label

fd-form-label · 4 examples from SAP's documentation · Back to the gallery

About

Form labels are used to identify form elements such as input fields, checkboxes and radio buttons. This component is best used as a child element of the **Form Item** component.

Default

Use the default form label when the field is optional and does not require special styling or behavior.

Required

To visually and programmatically indicate a required field, add the fd-form-label--required modifier to the label and use the required and aria-required="true" attributes on the input.

Colon

To display a label with a colon, add the fd-form-label--colon modifier.

Disabled

There are 3 ways to visually show that a label is disabled: 1. Add aria-disabled="true". This communicates to assistive technologies (like screen readers) that the label is representing a disabled UI element. 2. Add is-disabled class to fd-form-label class. 3. Add fd-form-label--disabled modifier class to fd-form-label class.