Forms gather information from users via inputs, such as text boxes, text areas, selects, checkboxes, and radio buttons. Labels sit atop these inputs.
Use to describe a form input and indicate whether the input is required or optional.
<label class="mds-form__label"> First Name </label>
<label class="mds-form__label"> First Name
<abbr class="mds-form__label-required-indicator" title="This field is required." aria-hidden="true">*</abbr>
<span class="mds-screenreader-only">Required Field.</span>
</label>
<label class="mds-form__label"> First Name
<span class="mds-form__label-optional"> (Optional) </span>
</label>
Use to solicit a short, single line of text or a number.
<input class="mds-form__input" type="text">
<input class="mds-form__input" type="text" disabled>
<input class="mds-form__input" type="text" placeholder="First Name">
Use when soliciting multiple lines of text.
<textarea class="mds-form__textarea"></textarea>
<textarea class="mds-form__textarea" disabled></textarea>
<textarea class="mds-form__textarea" placeholder="Tell us more here..."></textarea>
Use when affording a single selection from a predefined list of options.
<div class="mds-form__select">
<select class="mds-form__select-input">
<option class="mds-form__select-option" value="">Select an Expense Type</option>
<option class="mds-form__select-option" value="vacation">Vacation</option>
<option class="mds-form__select-option" value="public_college">Public College</option>
<option class="mds-form__select-option" value="private_college">Private College</option>
<option class="mds-form__select-option" value="medical">Medical</option>
</select>
<div class="mds-form__select-visual-wrap"></div>
<span class="mds-form__select-open-indicator">
<svg class="mds-icon mds-form__select-open-icon" aria-labelledby="title">
<title>caret-down--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#caret-down--s"></use>
</svg>
</span>
</div>
<div class="mds-form__select mds-form__select-input--disabled">
<select class="mds-form__select-input" disabled>
<option class="mds-form__select-option" value="">Select an Expense Type</option>
<option class="mds-form__select-option" value="vacation">Vacation</option>
<option class="mds-form__select-option" value="public_college">Public College</option>
<option class="mds-form__select-option" value="private_college">Private College</option>
<option class="mds-form__select-option" value="medical">Medical</option>
</select>
<div class="mds-form__select-visual-wrap"></div>
<span class="mds-form__select-open-indicator">
<svg class="mds-icon mds-form__select-open-icon" aria-labelledby="title">
<title>caret-down--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#caret-down--s"></use>
</svg>
</span>
</div>
Use when affording a binary selection.
<label class="mds-form__checkbox" for="i-accept-the-terms-and-conditions.--4323">
<input id="i-accept-the-terms-and-conditions.--4323" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> I accept the terms and conditions. </span>
</span>
</label>
<label class="mds-form__checkbox mds-form__checkbox--disabled" for="i-accept-the-terms-and-conditions.--47559">
<input id="i-accept-the-terms-and-conditions.--47559" type="checkbox" class="mds-form__checkbox-input" disabled />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> I accept the terms and conditions. </span>
</span>
</label>
<label class="mds-form__checkbox" for="i-accept-the-terms-and-conditions.--66786">
<input id="i-accept-the-terms-and-conditions.--66786" type="checkbox" class="mds-form__checkbox-input" checked />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> I accept the terms and conditions. </span>
</span>
</label>
<label class="mds-form__checkbox mds-form__checkbox--disabled" for="i-accept-the-terms-and-conditions.--82193">
<input id="i-accept-the-terms-and-conditions.--82193" type="checkbox" class="mds-form__checkbox-input" checked disabled />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> I accept the terms and conditions. </span>
</span>
</label>
:hover
and :active
conventions as the primary Button when checked.<fieldset class="mds-form__checkbox-group" role="group">
<legend class="mds-form__checkbox-group-label"> Select statistics to view. </legend>
<label class="mds-form__checkbox" for="average--11337">
<input id="average--11337" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Average </span>
</span>
</label>
<label class="mds-form__checkbox" for="minimum--31830">
<input id="minimum--31830" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Minimum </span>
</span>
</label>
<label class="mds-form__checkbox" for="maximum--7426">
<input id="maximum--7426" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Maximum </span>
</span>
</label>
<label class="mds-form__checkbox" for="medium--17818">
<input id="medium--17818" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Medium </span>
</span>
</label>
</fieldset>
<div class="mds-form__field-group mds-form__field-group--horizontal">
<fieldset class="mds-form__checkbox-group" role="group">
<legend class="mds-form__checkbox-group-label"> Select statistics to view. </legend>
<label class="mds-form__checkbox" for="average--37082">
<input id="average--37082" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Average </span>
</span>
</label>
<label class="mds-form__checkbox" for="minimum--37598">
<input id="minimum--37598" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Minimum </span>
</span>
</label>
<label class="mds-form__checkbox" for="maximum--8191">
<input id="maximum--8191" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Maximum </span>
</span>
</label>
<label class="mds-form__checkbox" for="medium--89774">
<input id="medium--89774" type="checkbox" class="mds-form__checkbox-input" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Medium </span>
</span>
</label>
</fieldset>
</div>
<label class="mds-form__checkbox" for="indeterminate-checkbox--70077">
<input id="indeterminate-checkbox--70077" type="checkbox" class="mds-form__checkbox-input" checked />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Indeterminate checkbox </span>
</span>
</label>
<!-- Something like the following Javascript would be required to set an indeterminate state on a checkbox -->
<script>
document.getElementById("indeterminate-checkbox--70077").indeterminate = true;
</script>
Use to afford a single selection from two or more options.
<label class="mds-form__radio-button" for="peer-group--34897">
<input id="peer-group--34897" name="undefined-basic-example" value="blue" type="radio" class="mds-form__radio-button-input" />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Peer Group </span>
</span>
</label>
<label class="mds-form__radio-button mds-form__radio-button--disabled" for="peer-group--31146">
<input id="peer-group--31146" name="undefined-basic-example" value="blue" type="radio" class="mds-form__radio-button-input" disabled />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Peer Group </span>
</span>
</label>
<label class="mds-form__radio-button" for="choose-this-one--48666">
<input id="choose-this-one--48666" name="radio-example-1" value="blue" type="radio" class="mds-form__radio-button-input" checked />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Choose this one </span>
</span>
</label>
<label class="mds-form__radio-button mds-form__radio-button--disabled" for="peer-group--5887">
<input id="peer-group--5887" name="undefined-basic-example-checked" value="blue" type="radio" class="mds-form__radio-button-input" checked disabled />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Peer Group </span>
</span>
</label>
<fieldset class="mds-form__radio-button-group" role="radiogroup">
<legend class="mds-form__radio-button-group-label"> Rank Within </legend>
<label class="mds-form__radio-button" for="your-list--98138">
<input id="your-list--98138" name="id-48569-basic-example-checked" value="blue" type="radio" class="mds-form__radio-button-input" checked />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Your List </span>
</span>
</label>
<label class="mds-form__radio-button" for="peer-group--48892">
<input id="peer-group--48892" name="id-48569-basic-example" value="blue" type="radio" class="mds-form__radio-button-input" />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Peer Group </span>
</span>
</label>
</fieldset>
<div class="mds-form__field-group mds-form__field-group--horizontal">
<fieldset class="mds-form__radio-button-group" role="radiogroup">
<legend class="mds-form__radio-button-group-label"> Rank Within </legend>
<label class="mds-form__radio-button" for="your-list--63585">
<input id="your-list--63585" name="id-11677-basic-example-checked" value="blue" type="radio" class="mds-form__radio-button-input" checked />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Your List </span>
</span>
</label>
<label class="mds-form__radio-button" for="peer-group--75771">
<input id="peer-group--75771" name="id-11677-basic-example" value="blue" type="radio" class="mds-form__radio-button-input" />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Peer Group </span>
</span>
</label>
</fieldset>
</div>
:hover
and :active
conventions as the primary Button.Use to describe the required-field indicator symbol.
<form class="mds-form" method="post" action="form/processor">
<span class="mds-form__required-fields-key">Required fields</span>
<div class="mds-form__field-group">
<label class="mds-form__label" for="required-first-name"> First Name
<abbr class="mds-form__label-required-indicator" title="This field is required." aria-hidden="true">*</abbr>
<span class="mds-screenreader-only">Required Field.</span>
</label>
<input class="mds-form__input" type="text" id="required-first-name"> </div>
</form>
Use to indicate form elements with invalid or missing entries, including a description of the error.
<div class="mds-form__field-group mds-form--error">
<label class="mds-form__label" for="error-first-name"> First Name
<abbr class="mds-form__label-required-indicator" title="This field is required." aria-hidden="true">*</abbr>
<span class="mds-screenreader-only">Required Field.</span>
</label>
<input class="mds-form__input" type="text" id="error-first-name" aria-describedby="first-name-error">
<span class="mds-form__field-error" id="first-name-error" role="alert">
<span class="mds-form__field-error-text"> This is placeholder error messaging. </span>
</span>
</div>
<div class="mds-form__field-group mds-form--error">
<label class="mds-form__label" for="error-textarea"> Comments
<abbr class="mds-form__label-required-indicator" title="This field is required." aria-hidden="true">*</abbr>
<span class="mds-screenreader-only">Required Field.</span>
</label>
<textarea class="mds-form__textarea" id="error-textarea" aria-describedby="textarea-error"></textarea>
<span class="mds-form__field-error" id="textarea-error" role="alert">
<span class="mds-form__field-error-text"> This is placeholder error messaging. </span>
</span>
</div>
<div class="mds-form__field-group mds-form--error">
<div class="mds-form__select">
<select class="mds-form__select-input">
<option class="mds-form__select-option" value="">Select an Expense Type</option>
<option class="mds-form__select-option" value="vacation">Vacation</option>
<option class="mds-form__select-option" value="public_college">Public College</option>
<option class="mds-form__select-option" value="private_college">Private College</option>
<option class="mds-form__select-option" value="medical">Medical</option>
</select>
<div class="mds-form__select-visual-wrap"></div>
<span class="mds-form__select-open-indicator">
<svg class="mds-icon mds-form__select-open-icon" aria-labelledby="title">
<title>caret-down--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#caret-down--s"></use>
</svg>
</span>
</div>
</div>
<div class="mds-form__field-group mds-form--error">
<fieldset class="mds-form__checkbox-group" role="group">
<legend class="mds-form__checkbox-group-label"> Select one or more statistics to view.
<abbr class="mds-form__label-required-indicator" title="Please select at least one option." aria-hidden="true">*</abbr>
<span class="mds-screenreader-only">Required Field.</span>
</legend>
<label class="mds-form__checkbox" for="average--37280">
<input id="average--37280" type="checkbox" class="mds-form__checkbox-input" aria-describedby="checkbox-error" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Average </span>
</span>
</label>
<label class="mds-form__checkbox" for="minimum--53684">
<input id="minimum--53684" type="checkbox" class="mds-form__checkbox-input" aria-describedby="checkbox-error" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Minimum </span>
</span>
</label>
<label class="mds-form__checkbox" for="maxiumum--58537">
<input id="maxiumum--58537" type="checkbox" class="mds-form__checkbox-input" aria-describedby="checkbox-error" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Maxiumum </span>
</span>
</label>
<label class="mds-form__checkbox" for="medium--60756">
<input id="medium--60756" type="checkbox" class="mds-form__checkbox-input" aria-describedby="checkbox-error" />
<span class="mds-form__checkbox-visible-wrap">
<span class="mds-form__checkbox-visual">
<svg class="mds-icon mds-form__checkbox-checked-icon" aria-labelledby="title">
<title>check--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#check--s"></use>
</svg>
<svg class="mds-icon mds-form__checkbox-indeterminate-icon" aria-labelledby="title">
<title>minus--s</title>
<use xlink:href="/assets/icons/mds_icons.svg#minus--s"></use>
</svg>
</span>
<span class="mds-form__checkbox-text"> Medium </span>
</span>
</label>
<span class="mds-form__field-error" id="checkbox-error" role="alert">
<span class="mds-form__field-error-text"> You must select at least one statistic. </span>
</span>
</fieldset>
</div>
<div class="mds-form__field-group mds-form--error">
<fieldset class="mds-form__radio-button-group" role="radiogroup">
<legend class="mds-form__radio-button-group-label"> Select what you would like to rank within.
<abbr class="mds-form__label-required-indicator" title="Please select an option." aria-hidden="true">*</abbr>
<span class="mds-screenreader-only">Required Field.</span>
</legend>
<label class="mds-form__radio-button" for="your-list--76682">
<input id="your-list--76682" name="group-name" value="blue" type="radio" class="mds-form__radio-button-input" aria-describedby="radio-button-error-message" />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Your List </span>
</span>
</label>
<label class="mds-form__radio-button" for="peer-group--86942">
<input id="peer-group--86942" name="group-name" value="blue" type="radio" class="mds-form__radio-button-input" aria-describedby="radio-button-error-message" />
<span class="mds-form__radio-button-visible-wrap">
<span class="mds-form__radio-button-visual"></span>
<span class="mds-form__radio-button-text "> Peer Group </span>
</span>
</label>
<span class="mds-form__field-error" id="radio-button-error-message" role="alert">
<span class="mds-form__field-error-text"> You must choose an option. </span>
</span>
</fieldset>
</div>
Augment a label to describe a form element in greater detail.
<div class="mds-form__field-group">
<label class="mds-form__label" for="password-with-microcopy"> Password </label>
<span class="mds-form__microcopy" id="password-help-text"> Your password must contain a letter and a number. </span>
<input class="mds-form__input" type="password" id="password-with-microcopy" aria-describedby="password-help-text"> </div>
<div class="mds-form__field-group">
<label class="mds-form__label" for="password-with-microcopy"> Password </label>
<input class="mds-form__input" type="password" id="password-with-microcopy" aria-describedby="password-help-text">
<span class="mds-form__microcopy" id="password-help-text"> Your password must contain a letter and a number. </span>
</div>
label
with each form element.for
attribute on each label
with a value matching the id
attribute on the corresponding input
, textarea
or select
.placeholder
text to provide an example of the type of input you need from the user. For example, if you need a phone number in a certain format, include xxx-xxx-xxxx
as placeholder text.placeholder
text in place of a label
.aria-describedby
attribute on each input
, textarea
, or select
that has an .mds-form__microcopy
or an .mds-form__field-error
component providing additional information. The value of the aria-describedby
attribute must match the id
attribute on the .mds-form__microcopy
or .mds-form__field-error
component. role=alert
on .mds-form__field-error
components.Class | Applies to | Outcome |
---|---|---|
|
|
Changes the layout of form fields from vertical to horizontal. |
|
|
Applies the MDS form error styles to |
|
|
Decreases padding and font size for an |
|
|
Increases padding and font size for an |
|
|
Decreases padding and font size for a |
|
|
Increases padding and font size for a |
|
|
Decreases padding and font size for a |
|
|
Increases padding and font size for a |