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

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="...">

Input Sizes

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">

Form Labels

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>

Helper Text & Validation

Feedback: Use helper text to provide guidance. Validation states visually indicate success or errors with colored borders and feedback messages.

We'll never share your email with anyone else.
Looks good!
Please enter a valid value. This field is required.
<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

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

Great choice!
Please make a selection.
<select class="tw-form-select">...</select>
<select class="tw-form-select tw-form-select-sm">...</select>

Textarea

Textarea: Multi-line text input for longer content like descriptions, comments, or messages.

Textarea Sizes

<textarea class="tw-form-control" rows="3"></textarea>

Checkbox

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 Buttons

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 Switch

Toggle: Binary on/off controls for settings and preferences. Use instead of checkboxes when the action takes immediate effect.

Keep everything neat and tidy to show even more content
<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

Input Groups: Combine inputs with text addons, icons, or buttons for contextual input fields.

@
.00
$ .00

Input Group Sizes

Small
Default
Large
<div class="tw-input-group">
  <span class="tw-input-group-text">@</span>
  <input class="tw-form-control">
</div>

Plaintext Display

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="...">

Common Form Patterns

Real-world examples: Typical form layouts and patterns you'll use in your application.

Login Form

Sign In

Contact Form

Contact Us

Settings with Toggles

Notification Preferences

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