A native input primitive with Bootstrap form semantics for labeled, helper-aware, and validated fields.
Use .form-control inputs for one-line values such as names, emails, search terms, urls, tokens, and numbers. Choose the native type that matches the data so mobile keyboards, browser validation, and autofill behavior work with the field instead of against it.
.form-control
type
Pair every standalone input with a visible label or an accessible name, and connect helper or error text with aria-describedby. Keep placeholder text as an example value only; it should not replace the label or carry required instructions.
aria-describedby
Set state on the native input: required for required fields, readonly when the value can be copied but not changed, disabled when it is unavailable, and invalid state when validation fails. Use Bootstrap sizing and form-control variants only after the field's semantics are already clear.
required
readonly
disabled
Use a labeled single input with helper text.
1 2 3 4 5<div class="field"> <label class="form-label" for="input-api-key">API Key</label> <input class="form-control" id="input-api-key" type="text" placeholder="sk-..." aria-describedby="input-api-key-help"> <div class="field-description form-text" id="input-api-key-help">Your API key is encrypted and stored securely.</div> </div>
<div class="field"> <label class="form-label" for="input-api-key">API Key</label> <input class="form-control" id="input-api-key" type="text" placeholder="sk-..." aria-describedby="input-api-key-help"> <div class="field-description form-text" id="input-api-key-help">Your API key is encrypted and stored securely.</div> </div>
Use a single input when surrounding context or an explicit aria-label provides the accessible name.
1 2 3<div class="field"> <input class="form-control" type="text" placeholder="Enter your text" aria-label="Input"> </div>
<div class="field"> <input class="form-control" type="text" placeholder="Enter your text" aria-label="Input"> </div>
Wrap a label and input together in a .field container to keep spacing consistent under Bootstrap form semantics.
.field
1 2 3 4 5<div class="field"> <label class="form-label" for="input-field-email">Email</label> <input class="form-control" id="input-field-email" type="text" placeholder="you@example.com" aria-describedby="input-field-email-help"> <div class="field-description form-text" id="input-field-email-help">We'll only use this to send you updates.</div> </div>
<div class="field"> <label class="form-label" for="input-field-email">Email</label> <input class="form-control" id="input-field-email" type="text" placeholder="you@example.com" aria-describedby="input-field-email-help"> <div class="field-description form-text" id="input-field-email-help">We'll only use this to send you updates.</div> </div>
Group related fields inside a .field-group to keep rhythm and spacing token-driven.
.field-group
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16<fieldset class="field-fieldset"> <legend class="field-legend">Developer profile</legend> <div class="field-description form-text">Shown on the shared team roster.</div> <div class="field-group"> <div class="field"> <label class="form-label" for="input-first-name">First name</label> <input class="form-control" id="input-first-name" type="text" placeholder="Ada" aria-describedby="input-first-name-help"> <div class="field-description form-text" id="input-first-name-help">Displayed in activity headers.</div> </div> <div class="field"> <label class="form-label" for="input-last-name">Last name</label> <input class="form-control" id="input-last-name" type="text" placeholder="Lovelace" aria-describedby="input-last-name-help"> <div class="field-description form-text" id="input-last-name-help">Used for routing and search matching.</div> </div> </div> </fieldset>
<fieldset class="field-fieldset"> <legend class="field-legend">Developer profile</legend> <div class="field-description form-text">Shown on the shared team roster.</div> <div class="field-group"> <div class="field"> <label class="form-label" for="input-first-name">First name</label> <input class="form-control" id="input-first-name" type="text" placeholder="Ada" aria-describedby="input-first-name-help"> <div class="field-description form-text" id="input-first-name-help">Displayed in activity headers.</div> </div> <div class="field"> <label class="form-label" for="input-last-name">Last name</label> <input class="form-control" id="input-last-name" type="text" placeholder="Lovelace" aria-describedby="input-last-name-help"> <div class="field-description form-text" id="input-last-name-help">Used for routing and search matching.</div> </div> </div> </fieldset>
Use readonly on a single field to preserve visible context without editing.
1 2 3 4<div class="field"> <label class="form-label" for="input-default-region">Default region</label> <input class="form-control" id="input-default-region" type="text" value="us-east-1" readonly> </div>
<div class="field"> <label class="form-label" for="input-default-region">Default region</label> <input class="form-control" id="input-default-region" type="text" value="us-east-1" readonly> </div>
Use disabled on a control-level input to block interaction while keeping it readable.
1 2 3 4 5<div class="field"> <label class="form-label" for="input-disabled-slug">Workspace slug</label> <input class="form-control" id="input-disabled-slug" type="text" placeholder="acme-corp" disabled aria-describedby="input-disabled-slug-help"> <div class="field-description form-text" id="input-disabled-slug-help">Contact an owner to change the workspace slug.</div> </div>
<div class="field"> <label class="form-label" for="input-disabled-slug">Workspace slug</label> <input class="form-control" id="input-disabled-slug" type="text" placeholder="acme-corp" disabled aria-describedby="input-disabled-slug-help"> <div class="field-description form-text" id="input-disabled-slug-help">Contact an owner to change the workspace slug.</div> </div>
Use aria-invalid="true" to mark a field as invalid alongside descriptive helper text.
aria-invalid="true"
1 2 3 4 5<div class="field" data-invalid="true"> <label class="form-label" for="input-invalid">Invalid Input</label> <input class="form-control is-invalid" id="input-invalid" type="text" placeholder="Error" aria-invalid="true" aria-describedby="input-invalid-help"> <div class="field-description form-text" id="input-invalid-help">This field contains validation errors.</div> </div>
<div class="field" data-invalid="true"> <label class="form-label" for="input-invalid">Invalid Input</label> <input class="form-control is-invalid" id="input-invalid" type="text" placeholder="Error" aria-invalid="true" aria-describedby="input-invalid-help"> <div class="field-description form-text" id="input-invalid-help">This field contains validation errors.</div> </div>
Use Bootstrap's native custom file input pattern inside an .input-group.
.input-group
1 2 3 4 5<div class="field"> <div class="input-group"> <input class="form-control" id="input-picture" type="file" aria-label="Upload"> </div> </div>
<div class="field"> <div class="input-group"> <input class="form-control" id="input-picture" type="file" aria-label="Upload"> </div> </div>
Place an input field next to a button in a flex row to create a search input with a button.
1 2 3 4 5 6<div class="d-flex gap-2 w-100"> <div class="field flex-fill"> <input class="form-control" type="search" placeholder="Search..." aria-label="Search"> </div> <button class="btn btn-primary" type="button">Search</button> </div>
<div class="d-flex gap-2 w-100"> <div class="field flex-fill"> <input class="form-control" type="search" placeholder="Search..." aria-label="Search"> </div> <button class="btn btn-primary" type="button">Search</button> </div>
Use a flex row of .field.flex-fill containers to place multiple inputs side by side.
.field.flex-fill
1 2 3 4 5 6 7 8 9 10<div class="d-flex flex-wrap gap-3"> <div class="field flex-fill"> <label class="form-label" for="input-grid-city">City</label> <input class="form-control" id="input-grid-city" type="text" placeholder="Amsterdam"> </div> <div class="field flex-fill"> <label class="form-label" for="input-grid-postal-code">Postal code</label> <input class="form-control" id="input-grid-postal-code" type="text" placeholder="1011 AB"> </div> </div>
<div class="d-flex flex-wrap gap-3"> <div class="field flex-fill"> <label class="form-label" for="input-grid-city">City</label> <input class="form-control" id="input-grid-city" type="text" placeholder="Amsterdam"> </div> <div class="field flex-fill"> <label class="form-label" for="input-grid-postal-code">Postal code</label> <input class="form-control" id="input-grid-postal-code" type="text" placeholder="1011 AB"> </div> </div>
Use the required attribute to indicate required inputs.
1 2 3 4 5 6 7 8<div class="field"> <label class="form-label" for="input-required"> Project name <span class="text-danger">*</span> </label> <input class="form-control" id="input-required" type="text" placeholder="marketing-site" required aria-describedby="input-required-help"> <div class="field-description form-text" id="input-required-help">Used to generate the deployment URL.</div> </div>
<div class="field"> <label class="form-label" for="input-required"> Project name <span class="text-danger">*</span> </label> <input class="form-control" id="input-required" type="text" placeholder="marketing-site" required aria-describedby="input-required-help"> <div class="field-description form-text" id="input-required-help">Used to generate the deployment URL.</div> </div>
Add a .badge inside the label to highlight a recommended field.
.badge
1 2 3 4 5 6 7<div class="field"> <label class="form-label d-flex align-items-center justify-content-between" for="input-badge"> API endpoint <span class="badge text-bg-secondary">Preview</span> </label> <input class="form-control" id="input-badge" type="text" placeholder="https://api.acme.dev/v1/webhook"> </div>
<div class="field"> <label class="form-label d-flex align-items-center justify-content-between" for="input-badge"> API endpoint <span class="badge text-bg-secondary">Preview</span> </label> <input class="form-control" id="input-badge" type="text" placeholder="https://api.acme.dev/v1/webhook"> </div>
To add icons or text inside an input, wrap it in a Bootstrap .input-group. See the Input Group component for more examples.
1 2 3 4 5 6<div class="field"> <div class="input-group"> <span class="input-group-text">https://</span> <input class="form-control" id="input-group-url" type="text" placeholder="example.com" aria-label="Website URL"> </div> </div>
<div class="field"> <div class="input-group"> <span class="input-group-text">https://</span> <input class="form-control" id="input-group-url" type="text" placeholder="example.com" aria-label="Website URL"> </div> </div>
Use Bootstrap's native .input-group pattern to attach a button to a search input with a shared border. See the Button Group component for button-only groups.
1 2 3 4 5 6 7<div class="field"> <label class="form-label" for="input-button-group-search">Search</label> <div class="input-group"> <input class="form-control" id="input-button-group-search" type="search" placeholder="Type to search..." aria-label="Search"> <button class="btn btn-outline-secondary" type="button">Search</button> </div> </div>
<div class="field"> <label class="form-label" for="input-button-group-search">Search</label> <div class="input-group"> <input class="form-control" id="input-button-group-search" type="search" placeholder="Type to search..." aria-label="Search"> <button class="btn btn-outline-secondary" type="button">Search</button> </div> </div>
A full form example composed from a <fieldset>, a .field-group, and labeled fields. See the Fieldset section for the legend/description contract.
<fieldset>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42<form class="field-form needs-validation mx-auto" novalidate> <fieldset class="field-fieldset"> <legend class="field-legend">Shipping details</legend> <div class="field-description form-text">Used to calculate delivery time and customs fees.</div> <div class="field-group"> <div class="field"> <label class="form-label" for="input-form-name"> Full name <span class="text-danger">*</span> </label> <input class="form-control" id="input-form-name" type="text" placeholder="Ada Lovelace" required> </div> <div class="field"> <label class="form-label" for="input-form-email">Email</label> <input class="form-control" id="input-form-email" type="text" placeholder="you@example.com" aria-describedby="input-form-email-help"> <div class="field-description form-text" id="input-form-email-help">Order updates are sent to this address.</div> </div> <div class="d-flex flex-wrap gap-3"> <div class="field flex-fill"> <label class="form-label" for="input-form-phone">Phone</label> <input class="form-control" id="input-form-phone" type="text" placeholder="+31 20 123 4567"> </div> <div class="field flex-fill"> <label class="form-label" for="input-form-country">Country</label> <select class="form-select" id="input-form-country" data-selected="nl"> <option value="nl" selected>Netherlands</option> <option value="de">Germany</option> <option value="us">United States</option> </select> </div> </div> <div class="field"> <label class="form-label" for="input-form-address">Address</label> <input class="form-control" id="input-form-address" type="text" placeholder="Damrak 1, 1012 LG"> </div> </div> </fieldset> <div class="d-flex gap-2 justify-content-end mt-3"> <button class="btn btn-outline-secondary" type="reset">Cancel</button> <button class="btn btn-primary" type="submit">Submit</button> </div> </form>
<form class="field-form needs-validation mx-auto" novalidate> <fieldset class="field-fieldset"> <legend class="field-legend">Shipping details</legend> <div class="field-description form-text">Used to calculate delivery time and customs fees.</div> <div class="field-group"> <div class="field"> <label class="form-label" for="input-form-name"> Full name <span class="text-danger">*</span> </label> <input class="form-control" id="input-form-name" type="text" placeholder="Ada Lovelace" required> </div> <div class="field"> <label class="form-label" for="input-form-email">Email</label> <input class="form-control" id="input-form-email" type="text" placeholder="you@example.com" aria-describedby="input-form-email-help"> <div class="field-description form-text" id="input-form-email-help">Order updates are sent to this address.</div> </div> <div class="d-flex flex-wrap gap-3"> <div class="field flex-fill"> <label class="form-label" for="input-form-phone">Phone</label> <input class="form-control" id="input-form-phone" type="text" placeholder="+31 20 123 4567"> </div> <div class="field flex-fill"> <label class="form-label" for="input-form-country">Country</label> <select class="form-select" id="input-form-country" data-selected="nl"> <option value="nl" selected>Netherlands</option> <option value="de">Germany</option> <option value="us">United States</option> </select> </div> </div> <div class="field"> <label class="form-label" for="input-form-address">Address</label> <input class="form-control" id="input-form-address" type="text" placeholder="Damrak 1, 1012 LG"> </div> </div> </fieldset> <div class="d-flex gap-2 justify-content-end mt-3"> <button class="btn btn-outline-secondary" type="reset">Cancel</button> <button class="btn btn-primary" type="submit">Submit</button> </div> </form>
Use the same labeled helper-text pattern across Arabic and Hebrew RTL examples, with English as the LTR comparison.
1 2 3 4 5 6 7<div dir="rtl" class="w-100"> <div class="field"> <label class="form-label" for="input-rtl-arabic">مفتاح API</label> <input class="form-control" id="input-rtl-arabic" type="text" placeholder="sk-..." aria-describedby="input-rtl-arabic-help"> <div class="field-description form-text" id="input-rtl-arabic-help">مفتاح API الخاص بك آمن ومشفر.</div> </div> </div>
<div dir="rtl" class="w-100"> <div class="field"> <label class="form-label" for="input-rtl-arabic">مفتاح API</label> <input class="form-control" id="input-rtl-arabic" type="text" placeholder="sk-..." aria-describedby="input-rtl-arabic-help"> <div class="field-description form-text" id="input-rtl-arabic-help">مفتاح API الخاص بك آمن ومشفر.</div> </div> </div>
1 2 3 4 5 6 7<div dir="rtl" class="w-100"> <div class="field"> <label class="form-label" for="input-rtl-hebrew">מפתח API</label> <input class="form-control" id="input-rtl-hebrew" type="text" placeholder="sk-..." aria-describedby="input-rtl-hebrew-help"> <div class="field-description form-text" id="input-rtl-hebrew-help">המפתח שלך מאובטח ומוצפן.</div> </div> </div>
<div dir="rtl" class="w-100"> <div class="field"> <label class="form-label" for="input-rtl-hebrew">מפתח API</label> <input class="form-control" id="input-rtl-hebrew" type="text" placeholder="sk-..." aria-describedby="input-rtl-hebrew-help"> <div class="field-description form-text" id="input-rtl-hebrew-help">המפתח שלך מאובטח ומוצפן.</div> </div> </div>
1 2 3 4 5 6 7<div dir="ltr" class="w-100"> <div class="field"> <label class="form-label" for="input-rtl-english">API Key</label> <input class="form-control" id="input-rtl-english" type="text" placeholder="sk-..." aria-describedby="input-rtl-english-help"> <div class="field-description form-text" id="input-rtl-english-help">Your key is encrypted and stored securely.</div> </div> </div>
<div dir="ltr" class="w-100"> <div class="field"> <label class="form-label" for="input-rtl-english">API Key</label> <input class="form-control" id="input-rtl-english" type="text" placeholder="sk-..." aria-describedby="input-rtl-english-help"> <div class="field-description form-text" id="input-rtl-english-help">Your key is encrypted and stored securely.</div> </div> </div>
For more form control options, see the Bootstrap Form controls documentation.
No matching pages.
Restore the default appearance.