Bootstrap Input Groups: Mastering Form Layouts

Ruth Jul 09, 2026

Bootstrap, the popular front-end framework, offers a wide range of pre-built components to streamline web development. One such component is the input group, designed to manage multiple form inputs within a single control. This feature is particularly useful when you need to combine inputs like search fields, date pickers, or form elements with buttons. Let's delve into the Bootstrap input groups, their usage, and best practices.

Bootstrap Input Groups - Tutlane
Bootstrap Input Groups - Tutlane

Bootstrap input groups allow you to create complex forms with ease. They provide a consistent look and feel across your website, enhancing user experience and saving you time. By combining inputs and add-ons (like buttons, dropdowns, or custom content), you can create intuitive and responsive forms that work seamlessly on various devices.

an image of a web page with some type of text in the bottom right corner
an image of a web page with some type of text in the bottom right corner

Setting Up Bootstrap Input Groups

To start using input groups, you'll first need to include the Bootstrap CSS and JavaScript files in your project. If you're using a CDN, add the following lines in your HTML file's head section:

the login page for an email form with two different types of mailboxes
the login page for an email form with two different types of mailboxes

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>

Basic Input Group Structure

an email form with two different types of letters and numbers on the top right hand corner
an email form with two different types of letters and numbers on the top right hand corner

An input group consists of an input field and an optional add-on. The basic structure is as follows:

<div class="input-group mb-3"> <span class="input-group-text">@</span> <input type="text" class="form-control" placeholder="Username"> </div>

In this example, the input field is a text box with a placeholder "Username". The add-on is a span element with the text "@".

HTML/CSS Bootstrap 5 Search
HTML/CSS Bootstrap 5 Search

Adding Buttons and Dropdowns

You can add buttons and dropdowns to your input groups to create more complex forms. Here's how you can do it:

<div class="input-group mb-3"> <input type="text" class="form-control" placeholder="Search"> <button class="btn btn-outline-secondary" type="button" id="button-addon1">Button</button> </div>

an image of different types of cats
an image of different types of cats

And for dropdowns:

<div class="input-group mb-3"> <input type="text" class="form-control" placeholder="Recipient's username"> <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</button> <ul class="dropdown-menu"> <li><a class="dropdown-item" href="#">Action</a></li> <li><a class="dropdown-item" href="#">Another action</a></li> <li><a class="dropdown-item" href="#">Something else here</a></li> </ul> </div>

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
How to Create Bootstrap 5 Navigation Header? – WebNots
How to Create Bootstrap 5 Navigation Header? – WebNots
Wizard
Wizard
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
Bootstrap 4 Modal Dialog Form-Wizard
Bootstrap 4 Modal Dialog Form-Wizard
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Add remove input fields dynamically using jQuery and bootstrap
Add remove input fields dynamically using jQuery and bootstrap
Cliq – Bootstrap 5 Admin Dashboards -NULLED- – NullBulls
Cliq – Bootstrap 5 Admin Dashboards -NULLED- – NullBulls
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
BOOTSTRAP : MOST USEFUL CODES TO USE WHILE CODING
BOOTSTRAP : MOST USEFUL CODES TO USE WHILE CODING
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
an iphone screen with the text, community and other things to see in this image
an iphone screen with the text, community and other things to see in this image
the bootstrap 4 website is displayed in three different colors and font styles, including purple
the bootstrap 4 website is displayed in three different colors and font styles, including purple

Responsive Behavior and Customization

Bootstrap input groups are responsive and will adjust their layout based on the screen size. You can customize the behavior using the grid system or by adding custom CSS. For instance, you can make the add-ons full-width on smaller screens:

<div class="input-group input-group-sm mb-3"> <input type="text" class="form-control" placeholder="Small text"> <button class="btn btn-outline-secondary" type="button">Button</button> </div>

Nesting Input Groups

You can nest input groups to create even more complex forms. Here's an example:

<div class="input-group mb-3"> <input type="text" class="form-control" placeholder="Username"> <div class="input-group-append"> <span class="input-group-text">@</span> </div> </div>

In this case, the input field is nested within an input group, and the add-on is another input group itself.

Using Input Groups with Form Controls

Input groups can be used with various form controls like checkboxes, radio buttons, and switches. Here's an example with a checkbox:

<div class="input-group"> <div class="input-group-text"> <input class="form-check-input" type="checkbox" value="" id="inputGroupCheckbox01"> </div> <input type="text" class="form-control" placeholder="Example checkbox input"> </div>

In conclusion, Bootstrap input groups are a powerful tool for creating responsive and intuitive forms. They allow you to combine inputs and add-ons, creating a consistent look and feel across your website. By understanding the basic structure and best practices, you can harness the full potential of input groups in your projects.