Class 15 of 48 • Forms & Inputs

Bootstrap 5 Input Groups: Text Addons, Buttons & Dropdowns

Input groups extend form controls by prepending or appending text labels, currency symbols, icons, action buttons, or dropdown menus on either side of an input field. In Bootstrap 5, input groups seamlessly join borders and manage border-radius rounding automatically.

Bootstrap 5 Input Groups: Prepend, Append, Icons, and Buttons
Figure 15: Input group architecture: prepending symbols (@, $), appending action buttons, and segmented dropdown addons.

1. Basic Text Addons (.input-group-text)

Wrap your input and addon elements inside a container with the .input-group class. Use .input-group-text to style static labels:

<!-- Prepend @ for Username -->
<div class="input-group mb-3">
  <span class="input-group-text" id="addon-username">@</span>
  <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="addon-username">
</div>

<!-- Prepend Currency and Append .00 -->
<div class="input-group mb-3">
  <span class="input-group-text">₹</span>
  <input type="text" class="form-control" placeholder="Course Fee Amount" aria-label="Amount in Rupees">
  <span class="input-group-text">.00</span>
</div>

2. Button Addons (Search Bars & Action Triggers)

Combine inputs with action buttons to create modern search bars and newsletter subscription boxes:

<!-- Search Bar with Button -->
<div class="input-group mb-3">
  <input type="text" class="form-control" placeholder="Search tutorials..." aria-label="Search tutorials">
  <button class="btn btn-primary" type="button" id="button-search">
    <i class="fa fa-search"></i> Search
  </button>
</div>

3. Segmented Dropdowns in Input Groups

Attach dropdown menus to inputs for multi-category filtering:

<div class="input-group mb-3">
  <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Category</button>
  <ul class="dropdown-menu">
    <li><a class="dropdown-item" href="#">HTML / CSS</a></li>
    <li><a class="dropdown-item" href="#">Bootstrap 5</a></li>
    <li><a class="dropdown-item" href="#">JavaScript</a></li>
  </ul>
  <input type="text" class="form-control" placeholder="Type query here..." aria-label="Text input with dropdown">
</div>

Explore Related Bootstrap Tutorials & Next Steps

Strengthen your responsive web design mastery by studying these connected classes:

Form Controls & Basics

Review input types, textareas, file inputs, and size modifiers.

Button Addons in Input Groups

Attach search buttons and action toggles directly to input fields.

Dropdown Menus inside Inputs

Create currency or category pickers embedded inside text inputs.

Validating Input Groups

Properly place invalid-feedback messages when inputs are grouped.

Frequently Asked Questions (FAQ) - Student & Interview Review

Yes! Apply .input-group-lg or .input-group-sm to the parent .input-group container. All inputs, text addons, and buttons inside will scale automatically.
Yes! Place <input class='form-check-input mt-0' type='checkbox'> inside a <span class='input-group-text'>.
Bootstrap deliberately removes adjacent internal borders and rounds only the outermost corners to prevent ugly double-border thickness.

Next Step in Your Bootstrap Learning Path:

Advance your practical frontend engineering skills with the next topic in our synchronized curriculum.

Continue to Class 16: Floating Labels → Previous: ← Class 14: Select Menus & Range | Full Syllabus

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Reddit

You may also like this!