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 field</span>
<mds-required-fields-key>Required field</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 field</span>
<mds-required-fields-key size="small">Required field</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. |
|
|
Applies touch styles to the required fields key text. |
Use this mixin to create media queries in your product styles to switch required fields keys to their touch variation.
@include mds-required-field-key-touch-properties();
@include mds-form-all-touch-properties();
mixin for efficiency.When setting props as attributes on a custom HTML element, use kebab-case
instead of camelCase
.
Prop
|
Type
|
Validation
|
Default
|
Description
|
---|---|---|---|---|
|
String |
— |
— |
A space-separated list of class names that will be appended to the default |
|
String |
One of: |
|
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. |
Pass text in between the <mds-required-fields-key></mds-required-fields-key>
tags to set the required fields key’s text. This can be overridden with the text
prop.
Setting size
via props. Using the default slot for text
content:
<mds-required-fields-key size="small">
Required Fields
</mds-required-fields-key>