Used to label form elements such as TextField and Dropdown.
State | Applied to | Result |
---|---|---|
.is-required |
.ms-Label |
Marks the form element as required. |
.is-disabled |
.ms-Label |
Marks the form element as disabled. |
-
Confirm that you have references to Fabric's CSS on your page:
<head> <link rel="stylesheet" href="fabric.min.css"> <link rel="stylesheet" href="fabric.components.min.css"> </head>
-
Copy the HTML from one of the samples above into your page. For example:
<label class="ms-Label ">Name</label>
-
Replace the sample HTML content (such as the content of
.ms-Label
) with your content.
This component has no dependencies on other components.
When used with a form element, add a for
attribute that matches the id
attribute of the field.