Text, email, number, search, tel, and url inputs, plus textarea. Styled classless or with .mdst-input, with borderless, focus, and invalid states.
Types
| Class | Example |
|---|---|
| .mdst-input | |
| type="email" | |
| type="number" | |
| type="search" | |
| type="tel" | |
| type="url" | |
| .mdst-input on <textarea> |
States
| Attribute | Example |
|---|---|
| placeholder | |
| aria-invalid="true" | |
| disabled |
The class is optional inside .mdst-ui. A bare <input type="text"> there gets the same styles. Variants still need their modifier (.mdst-input--borderless), which works without .mdst-input.
Usage
<!-- Text input -->
<input type="text" class="mdst-input" placeholder="Enter text" />
<!-- Any text-like type: email, number, search, tel, url -->
<input type="email" class="mdst-input" placeholder="you@example.com" />
<!-- Invalid -->
<input type="email" class="mdst-input" aria-invalid="true" />
<!-- Textarea -->
<textarea class="mdst-input" placeholder="Write something..."></textarea>
<!-- Disabled -->
<input type="text" class="mdst-input" disabled />