Quick Demo
Loading...
Quick Start
Label, in most of the times, is used with the form control elements (eg., text area, input, ... ) to handle the accessibility.
To allow it to provide accessibility features, just make sure match the htmlFor prop to the id of the associated form control element. Note that:
- one label can only associate with one form control element.
- ensure the form control element use the native element such as input, textarea as a base.
Since Label is usually used with form controls, it's probably often used in the form context, and in that case, you will use <FormLabel> inside <Label>, and then the matching thing we mentioned will just be handled automatically under the hood.