FORM CONTROLS: Complete reference for all form input components
VARIANTS: Text Input | Select | Textarea | Checkbox | Radio | Toggle | Validation
Form controls are the primary way users enter data into your application. Use consistent styling, clear labels, and helpful validation feedback to guide users through forms efficiently.
Text Inputs: Basic single-line text entry fields. Use for names, emails, numbers, and other short text data.
<input type="text" class="tw-form-control" placeholder="...">
Sizes: Three size options to match your UI density. Default size works for most cases.
<input class="tw-form-control tw-form-control-sm"><input class="tw-form-control tw-form-control-lg">
Labels: Every form field must have a visible label. Use required/optional indicators to communicate field requirements clearly.
<label class="tw-form-label">Label</label><label class="tw-form-label tw-form-label-required">Required</label><label class="tw-form-label tw-form-label-optional">Optional</label>
Feedback: Use helper text to provide guidance. Validation states visually indicate success or errors with colored borders and feedback messages.
<input class="tw-form-control tw-is-valid"><input class="tw-form-control tw-is-invalid"><span class="tw-form-text">Helper text</span><span class="tw-valid-feedback">Success message</span><span class="tw-invalid-feedback">Error message</span>
Select: Dropdown menus for choosing from a list of options. Use when there are more than 5 options or when options are dynamic.
Select Sizes
Select with Validation
<select class="tw-form-select">...</select><select class="tw-form-select tw-form-select-sm">...</select>
Textarea: Multi-line text input for longer content like descriptions, comments, or messages.
Textarea Sizes
<textarea class="tw-form-control" rows="3"></textarea>
Checkbox: Use for multiple selections where users can choose one or more options, or for boolean toggles like accepting terms.
Inline Checkboxes
Checkbox with Validation
<div class="tw-form-check"> <input class="tw-form-check-input" type="checkbox" id="..."> <label class="tw-form-check-label" for="...">Label</label></div>
Radio: Use for single selections where only one option can be chosen from a group.
Inline Radio Buttons
<input class="tw-form-check-input" type="radio" name="group" id="...">
Toggle: Binary on/off controls for settings and preferences. Use instead of checkboxes when the action takes immediate effect.
<div class="tw-form-switch"> <input class="tw-form-check-input" type="checkbox" id="..."> <label class="tw-form-check-label" for="...">Label</label></div>
Input Groups: Combine inputs with text addons, icons, or buttons for contextual input fields.
Input Group Sizes
<div class="tw-input-group"> <span class="tw-input-group-text">@</span> <input class="tw-form-control"></div>
Plaintext: Display form values as plain text when in read-only mode while maintaining form layout alignment.
<input type="text" readonly class="tw-form-control-plaintext" value="...">
Real-world examples: Typical form layouts and patterns you'll use in your application.
Login Form
Contact Form
Settings with Toggles
Quick Reference
Text Input: .tw-form-control
Select: .tw-form-select
Sizes: .tw-form-control-sm | .tw-form-control-lg | .tw-form-select-sm | .tw-form-select-lg
Validation: .tw-is-valid | .tw-is-invalid
Labels: .tw-form-label | .tw-form-label-required | .tw-form-label-optional | .tw-form-label-sm | .tw-form-label-lg
Feedback: .tw-form-text | .tw-valid-feedback | .tw-invalid-feedback
Checkbox/Radio: .tw-form-check > .tw-form-check-input + .tw-form-check-label
Inline: .tw-form-check-inline
Toggle: .tw-form-switch > .tw-form-check-input + .tw-form-check-label
Input Group: .tw-input-group > .tw-input-group-text + .tw-form-control
Input Group Sizes: .tw-input-group-sm | .tw-input-group-lg
Plaintext: .tw-form-control-plaintext
States: disabled attribute | readonly attribute