Input fields and text areas, or textboxes, are used to enter or edit text or numbers.
Use when
The user needs to enter or edit data.
Design
Inputs and textareas
Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel and color.
Add the disabled attribute on an input to prevent user input and trigger a slightly different look. You can also add it as class on each element that you need to be disabled from your form or add it as attribute or class to a <fieldset> to disable all the controls within the <fieldset> at once.
Add the readonly attribute on an input to prevent user input. Readonly fields are displayed with a muted background and border to indicate they are not editable.
The <select> element does not natively support the readonly attribute. To prevent interaction, combine readonly with tabindex="-1". The styling is applied via CSS, but the browser will not enforce readonly behaviour on its own.
<divclass="input-group"id="input-group-btn-first"><divclass="input-group-btn"><buttontype="button"class="btn">Action</button></div><inputtype="text"class="form-control"placeholder="Text input..."aria-label="Input group button first example"></div><br><br><divclass="input-group"id="input-group-btn-last"><inputtype="text"class="form-control"placeholder="Text input..."aria-label="Input group button last example"><divclass="input-group-btn"><buttontype="button"class="btn">Action</button></div></div>
Input group button sizes
Buttons inside an input group are automatically reduced to 32 px to match form controls, unless .btn-md or .btn-lg is applied.
The following examples intentionally use .btn-md (40 px) and .btn-lg (48 px) to demonstrate that explicit size modifiers override the default 32 px input-group button height. These will be taller than the form control by design.
<divclass="input-group"><buttontype="button"class="btn">Default</button><inputtype="text"class="form-control"placeholder="Text input..."aria-label="Default button in input group"></div><br><br><divclass="input-group"><inputtype="text"class="form-control"placeholder="Text input..."aria-label="Dropdown in input group"><divclass="dropdown"><buttontype="button"class="btn dropdown-toggle"id="inputGroupDropdownSize"data-toggle="dropdown"aria-haspopup="true"aria-expanded="false">Dropdown</button><ulclass="dropdown-menu"role="menu"aria-expanded="false"aria-hidden="true"aria-labelledby="inputGroupDropdownSize"><liclass="dropdown-item"><ahref="#!">Item 1</a></li></ul></div></div><br><br><p>The following examples intentionally use <code>.btn-md</code> (40 px) and <code>.btn-lg</code> (48 px) to demonstrate that explicit size modifiers override the default 32 px input-group button height. These will be taller than the form control by design.</p><divclass="input-group"><buttontype="button"class="btn btn-md">Medium</button><inputtype="text"class="form-control"placeholder="Text input..."aria-label="Medium button in input group"></div><br><br><divclass="input-group"><buttontype="button"class="btn btn-lg">Large</button><inputtype="text"class="form-control"placeholder="Text input..."aria-label="Large button in input group"></div>