Forms combine layout utilities with state variants. Typical input chrome:
class="w-full rounded-lg border border-slate-300 px-3 py-2 text-sm focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-200"
Labels and errors
Associate <label for> with id. Show errors with text-red-600 text-sm and aria-invalid on fields. Utilities style the UI; HTML carries semantics from HTML forms.
Self-check
- Which attributes connect a label to an input?
- How would you style a disabled field?