Required-fields keys describe the required-field indicator symbol.
See Forms for guidance on composing full forms.
Use to describe the required-field indicator symbol.
<span class="mds-form__required-fields-key">Required fields</span>
<mds-required-fields-key>Required fields</mds-required-fields-key>
Sizing affects text size. The default size is medium, and you can use modifier classes or props to make the required fields key smaller or larger.
<span class="mds-form__required-fields-key mds-form__required-fields-key--small">Required fields</span>
<mds-required-fields-key size="small">Required fields</mds-required-fields-key>
Class
|
Applies to
|
Outcome
|
---|---|---|
|
|
Applies small styles to the required fields key text. |
|
|
Applies large styles to the required fields key text. |
Prop
|
Type
|
Validation
|
Default
|
Description
|
---|---|---|---|---|
|
String |
— |
— |
A space-separated list of class names that will be appended to the default |
|
String |
— |
— |
The |
|
String |
Enum: |
|
Alters the size of the required fields key. |
|
String |
Required |
— |
The text for the required fields key. Can also be passed via the default slot. |
Any text or markup passed in between the <mds-required-fields-key></mds-required-fields-key>
tags will be used as the required fields key’s text. This slot can accept plain text, or a combination of text and any tags where appropriate. If no content is passed in via the slot and the text
prop is empty, the required fields key content will be empty.
Setting the text and size:
<!-- Using Props -->
<mds-required-fields-key text="Required Fields" size="small"></mds-required-fields-key>
<!-- Using Slots -->
<mds-required-fields-key size="small"> Required Fields </mds-required-fields-key>