Input & Select
Text fields, selects and textareas, with icons and validation states.
How to use it
Copy any example below and paste it in- Classes
.form-label,.form-input,.form-select,.form-textarea,.form-help.- Icons
- Wrap in
.form-fieldand add.has-icon-startor.has-icon-endto the control. Do not reach for a bareps-10: the component class wins. - Select arrow
- Add
.select-fieldto the wrapper — the arrow is drawn in CSS so it matches the square geometry. - Invalid
aria-invalid="true"thickens the border and turns it red. Pair it with.form-errortext.
The set
We only use this for billing receipts.
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
<div>
<label class="form-label" for="f-name">Full name</label>
<input id="f-name" class="form-input" type="text" placeholder="Alex Mercer">
</div>
<div>
<label class="form-label" for="f-email">Email</label>
<div class="form-field">
<i class="bi bi-envelope-fill text-sm"></i>
<input id="f-email" class="form-input has-icon-start" type="email" placeholder="you@company.com">
</div>
<p class="form-help">We only use this for billing receipts.</p>
</div>
<div>
<label class="form-label" for="f-role">Role</label>
<div class="form-field select-field">
<select id="f-role" class="form-select">
<option>Administrator</option>
<option>Editor</option>
<option>Viewer</option>
</select>
</div>
</div>
<div>
<label class="form-label" for="f-amount">Amount</label>
<div class="form-field">
<i class="bi bi-currency-dollar text-sm"></i>
<input id="f-amount" class="form-input has-icon-start" type="number" placeholder="148">
</div>
</div>
<div class="sm:col-span-2">
<label class="form-label" for="f-note">Note</label>
<textarea id="f-note" class="form-textarea" rows="3" placeholder="Anything we should know?"></textarea>
</div>
</div>
Invalid and disabled
Enter an address in the form name@example.com.
Set when the account was created.
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
<div>
<label class="form-label" for="f-bad">Email</label>
<input id="f-bad" class="form-input" type="email" value="not-an-address"
aria-invalid="true" aria-describedby="f-bad-error">
<p class="form-error" id="f-bad-error">Enter an address in the form name@example.com.</p>
</div>
<div>
<label class="form-label" for="f-off">Account ID</label>
<input id="f-off" class="form-input" type="text" value="BR-44821" disabled>
<p class="form-help">Set when the account was created.</p>
</div>
</div>