VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-input-group-custom-select/

⇱ Bootstrap 5 Input group Custom Select - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Input group Custom Select

Last Updated : 6 Aug, 2024

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.

Bootstrap 5 Input group Custom select Classes: There is no specific class used to input group custom select. We use combinations of input-group classes with <select> tag and <option> tag within as needed.

Syntax:

<div class="input-group ...">
<label class="input-group-text" for="">...</label>
<select class="form-select" id="">
<option selected>....</option>
<option value="1">....</option>
<option value="2">....</option>
...
</select>
</div>

Example 1: This example illustrates how to custom-select elements from the options menu on the downside of the text input.

Output:

👁 output1
Bootstrap 5 Input group Custom Select

Example 2: In this example, illustrates how to custom-select elements from the options menu and adding a button on the left of the text input.

Output:

👁 output2
Bootstrap 5 Input group Custom Select

Reference:https://getbootstrap.com/docs/5.0/forms/input-group/#custom-select

Comment

Explore