Bootstrap 5 Input Group Button Addons Last Updated : 23 Jul, 2025 Suggest changes Share 1 Likes Like Report Bootstrap 5 Input Groups are used to extend form controls by adding the buttons, text, or button groups before or after the text inputs, custom selects, or file inputs. Input Group Button Addons are used to extend form controls by adding buttons or button groups.Bootstrap 5 Input group Button Addons Classes: There is no specific class used to create button addons. To create a button, we use .btn class and to create a button group, we use .btn-group class.Syntax:<div class="input-group"> <button class="btn ..." type="button">...</button> <input type="text" class="form-control" placeholder="..." aria-label="..."/> ...</div>Example 1: This example illustrates how to add buttons on the left and right of a text input. HTML <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap 5 Input group Button Addons</title> <link href= "https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity= "sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> </head> <body> <div class="container"> <div class="mt-1"> <h1 class="text-success">GeeksforGeeks</h1> <strong> Bootstrap 5 Input group Button Addons </strong> </div> <div class="w-50 mt-5"> <div class="input-group"> <button class="btn btn-danger"> Check Availability </button> <input type="text" class="form-control" placeholder="Enter Username" /> </div> <div class="input-group mt-4"> <input type="text" class="form-control" placeholder="Enter Address" /> <button class="btn btn-success"> Detect Location </button> </div> </div> </div> </body> </html> Output: Example 2: In this example, we show how to add continuous buttons on both sides of a text input on the left or right of the inputs. HTML <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap 5 Input group Button Addons</title> <link href= "https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity= "sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> </head> <body> <div class="container"> <div class="mt-4"> <h1 class="text-success">GeeksforGeeks</h1> <strong>Bootstrap 5 Input group Button Addons</strong> </div> <div class="w-45 mt-5"> <div class="input-group"> <button class="btn btn-success"> Left Button </button> <input type="text" class="form-control" placeholder="Enter Username"/> <button class="btn btn-danger"> Right Button </button> </div> <div class="input-group mt-3"> <button class="btn btn-success"> First name </button> <button class="btn btn-danger"> Middle name </button> <input type="text" class="form-control" placeholder="Enter Username"/> <button class="btn btn-success"> Last name </button> </div> </div> </div> </body> </html> Output: Reference: https://getbootstrap.com/docs/5.2/forms/input-group/#button-addons V vpsop Follow 1 Article Tags : Technical Scripter Web Technologies Bootstrap Technical Scripter 2022 Bootstrap-5 +1 More Explore Bootstrap 5 Tutorial 6 min read Bootstrap 5 Introduction 4 min read LayoutBootstrap 5 Layout Breakpoints 3 min read Bootstrap 5 Layout Containers 3 min read BootStrap 5 Layout Grid System 3 min read Bootstrap 5 Columns 2 min read Bootstrap 5 Gutters 2 min read Bootstrap 5 Utilities 2 min read Bootstrap 5 Z-index 2 min read ContentBootstrap Reboot 2 min read Bootstrap 5 Typography 2 min read Bootstrap 5 Images 1 min read Bootstrap 5 Tables 2 min read Bootstrap 5 Figures 2 min read FormsBootstrap-5 Forms 2 min read Bootstrap 5 Form Controls 2 min read Bootstrap 5 Select 2 min read Bootstrap 5 Checks and Radios 2 min read Bootstrap 5 Range 2 min read Bootstrap 5 Input Group 3 min read Bootstrap 5 Floating labels 2 min read Forms LayoutBootstrap 5 Layout Forms 2 min read Bootstrap5 Layout Utilities 2 min read Bootstrap 5 Layout Form Grid 2 min read Bootstrap 5 Layout Gutters 2 min read Bootstrap 5 Layout Horizontal form 2 min read Bootstrap 5 Layout Horizontal form label sizing 2 min read Bootstrap 5 Layout Column sizing 2 min read Bootstrap 5 Layout Auto-sizing 2 min read Bootstrap 5 Layout Inline forms 2 min read Bootstrap 5 Validation 4 min read ComponentsBootstrap 5 Accordion 3 min read Bootstrap 5 Alerts 2 min read Bootstrap 5 Badges 2 min read Bootstrap Breadcrumb 2 min read Bootstrap 5 Buttons 3 min read Bootstrap 5 | Button group 4 min read Bootstrap 5 | Card 11 min read Bootstrap 5 Carousel 3 min read Bootstrap 5 | Close button 1 min read Bootstrap 5 Collapse 3 min read Bootstrap 5 Dropdowns 9 min read Bootstrap 5 List group 5 min read Bootstrap 5 Modal 7 min read NavbarBootstrap 5 Navbar Brand 3 min read Bootstrap 5 Navbar Brand Text 2 min read Bootstrap Navbar Brand Image 2 min read Bootstrap 5 Navbar Nav 2 min read Bootstrap 5 Navbar Forms 2 min read Bootstrap 5 Navbar Text 2 min read Bootstrap 5 Offcanvas 12 min read Bootstrap 5 Popovers 2 min read Bootstrap 5 Progress 5 min read Bootstrap 5 Scrollspy 4 min read Bootstrap 5 Spinners 3 min read Bootstrap 5 Toasts 3 min read Bootstrap 5 Tooltips 3 min read HelpersBootstrap 5 Clearfix 2 min read Bootstrap 5 Colored links 2 min read Bootstrap 5 Ratios 2 min read Bootstrap 5 Position 2 min read Bootstrap 5 Visually hidden 2 min read Bootstrap 5 Stretched link 2 min read Bootstrap 5 Text Truncation 2 min read ExtendBootstrap 5 Approach 3 min read Bootstrap 5 Icons 2 min read My Profile ${profileImgHtml} My Profile Edit Profile My Courses Join Community Transactions Logout Like