Input
A component for displaying form input elements.
A component for displaying form input elements.
npm install @vrembem/input@use "@vrembem/input";Input uses design token CSS variables in a reference and fallback pattern. Variables are referenced in the component's styles but are not directly defined; instead, they are provided with sensible fallbacks.
| Variable | Fallback |
|---|---|
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
Copied! | Copied! |
There are no variables that match your search.
The most basic implementation of the input component consists of the input class applied to an <input> element.
<input class="input" type="text" placeholder="Example input..." />Adding the boolean disabled attribute to the input will provide visual indication that the input is not available for use.
<input class="input" type="text" disabled />Adding the boolean readonly attribute to the input will provide visual indication that the user should not be able to edit the value of the input.
<input class="input" type="text" readonly />Apply the input class to a <textarea> element to apply styles with textarea specific properties. use the rows attribute to adjust the initial height.
<textarea class="input" rows="3">...</textarea>Adding the is-invalid class or aria-invalid="true" attribute to the input will provide visual indication that the form-control value is invalid. Invalid state is also triggered by the native :user-invalid state.
<input class="input is-invalid" type="text" value="Invalid input..." />
<textarea class="input is-invalid" rows="3">...</textarea>