Input group

Extend form controls by adding text, buttons, etc. on either side.

Bootstrap docs

Addon position

@example.com
.00
<!-- Addon on the left -->
<div class="input-group mb-3">
  <span class="input-group-text">
    <i class="ai-lock"></i>
  </span>
  <input type="password" class="form-control" placeholder="Password">
</div>

<!-- Addon on the right -->
<div class="input-group mb-3">
  <input type="text" class="form-control" placeholder="Recipient's e-mail">
  <span class="input-group-text">@example.com</span>
</div>

<!-- Addons on both sides -->
<div class="input-group mb-3">
  <span class="input-group-text">
    <i class="ai-dollar-sign"></i>
  </span>
  <input type="text" class="form-control" placeholder="Amount">
  <span class="input-group-text">.00</span>
</div>
// Addon on the left
.input-group
  span.input-group-text
    i.ai-lock
  input(type="password", placeholder="Password").form-control

// Addon on the right
.input-group
  input(type="text", placeholder="Recipient's e-mail").form-control
  span.input-group-text
    | @example.com

// Addons on both sides
.input-group
  span.input-group-text
    i.ai-dollar-sign
  input(type="text", placeholder="Amount").form-control
  span.input-group-text
    | .00

Multiple addons

0.00
0.00
0.00
<!-- Multiple addons on left side -->
<div class="input-group mb-3">
  <span class="input-group-text">
    <i class="ai-dollar-sign"></i>
  </span>
  <span class="input-group-text">0.00</span>
  <input type="text" class="form-control" placeholder="Amount">
</div>

<!-- Multiple addons on right side -->
<div class="input-group mb-3">
  <input type="text" class="form-control" placeholder="Amount">
  <span class="input-group-text">
    <i class="ai-dollar-sign"></i>
  </span>
  <span class="input-group-text">0.00</span>
</div>

<!-- Multiple addons on both sides -->
<div class="input-group mb-3">
  <span class="input-group-text">
    <i class="ai-user"></i>
  </span>
  <span class="input-group-text">
    <i class="ai-credit-card"></i>
  </span>
  <input type="text" class="form-control" placeholder="Amount">
  <span class="input-group-text">
    <i class="ai-dollar-sign"></i>
  </span>
  <span class="input-group-text">0.00</span>
</div>
// Multiple addons on left side
.input-group.mb-3
  span.input-group-text
    i.ai-dollar-sign
  span.input-group-text 0.00
  input(type='text', placeholder='Amount').form-control

// Multiple addons on right side
.input-group.mb-3
  input(type='text', placeholder='Amount').form-control
  span.input-group-text 0.00
  span.input-group-text
    i.ai-dollar-sign

// Multiple addons on both sides
.input-group
  span.input-group-text
    i.ai-user
  span.input-group-text
    i.ai-credit-card
  input(type='text', placeholder='Amount').form-control
  span.input-group-text 0.00
  span.input-group-text
    i.ai-dollar-sign

Different types

Options
<!-- Icon addon -->
<div class="input-group mb-3">
  <span class="input-group-text">
    <i class="ai-message-square"></i>
  </span>
  <textarea class="form-control" placeholder="Type your message here..." rows="6"></textarea>
</div>

<!-- Textual addon -->
<div class="input-group mb-3">
  <span class="input-group-text text-heading">Options</span>
  <select class="form-select">
    <option>Choose one...</option>
    <option>One</option>
    <option>Two</option>
    <option>Three</option>
    <option>Four</option>
    <option>Five</option>
  </select>
</div>

<!-- Checkbox addon -->
<div class="input-group mb-3">
  <div class="input-group-text">
    <input class="form-check-input" type="checkbox">
  </div>
  <input class="form-control" type="text" placeholder="Checkbox here">
</div>

<!-- Radio button addon -->
<div class="input-group mb-3">
  <div class="input-group-text">
    <input class="form-check-input" type="radio" name="radio">
  </div>
  <input class="form-control" type="text" placeholder="Radio button here">
</div>
// Icon addon
.input-group.mb-3
  span.input-group-text
    i.ai-message-square
  textarea(placeholder="Type your message here...", rows="6").form-control

// Textual addon
.input-group.mb-3
  span.input-group-text.text-heading
    | Options
  select.form-select
    option Choose one...
    option One
    option Two
    option Three
    option Four
    option Five

// Checkbox addon
.input-group.mb-3
  .input-group-text
    input(type="checkbox").form-check-input
  input(type="text", placeholder="Checkbox here").form-control

// Radio button addon
.input-group.mb-3
  .input-group-text
    input(type="radio", name="radio").form-check-input
  input(type="text", placeholder="Radio button here").form-control

Multiple inputs

First & last name
<!-- Multiple inputs (addon on the left) -->
<div class="input-group">
  <span class="input-group-text text-heading">First &amp; last name</span>
  <input class="form-control" type="text" placeholder="First name">
  <input class="form-control" type="text" placeholder="Last name">
</div>

<!-- Multiple inputs (addon on the right) -->
<div class="input-group">
  <input class="form-control" type="time" value="07:45">
  <input class="form-control" type="time" value="09:00">
  <span class="input-group-text">
    <i class="ai-clock"></i>
  </span>
</div>
// Multiple inputs (addon on the left)
.input-group
  span.input-group-text.text-heading First &amp; last name
  input(type="text", placeholder="First name").form-control
  input(type="text", placeholder="Last name").form-control

// Multiple inputs (addon on the right)
.input-group
  input(type="time", value="07:45").form-control
  input(type="time", value="09:00").form-control
  span.input-group-text
    i.ai-clock

Button addons

<!-- Button addon on the left -->
<div class="input-group">
  <button class="btn btn-primary" type="button">Button</button>
  <input class="form-control" type="text" placeholder="Button on the left">
</div>

<!-- Button addon on the right -->
<div class="input-group">
  <input class="form-control" type="text" placeholder="Button on the right">
  <button class="btn btn-primary" type="button">Button</button>
</div>

<!-- Dropdown addon on the left -->
<div class="input-group">
  <button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown">Dropdown</button>
  <div class="dropdown-menu my-1">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
  </div>
  <input class="form-control" type="text" placeholder="Dropdown on the right">
</div>

<!-- Dropdown addon on the right -->
<div class="input-group">
  <input class="form-control" type="text" placeholder="Dropdown on the right">
  <button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown">Dropdown</button>
  <div class="dropdown-menu dropdown-menu-end my-1">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
  </div>
</div>

<!-- Multiple button addons -->
<div class="input-group">
  <input class="form-control" type="text" placeholder="Buttons on the right">
  <button class="btn btn-white border btn-icon" type="button">
    <i class="ai-edit"></i>
  </button>
  <button class="btn btn-white border btn-icon" type="button">
    <i class="ai-check text-success"></i>
  </button>
  <button class="btn btn-white border btn-icon" type="button">
    <i class="ai-trash-2 text-danger"></i>
  </button>
</div>
// Button addon on the left
.input-group
  button.btn.btn-primary(type="button") Button
  input(type="text", placeholder="Button on the left").form-control

// Button addon on the right
.input-group
  input(type="text", placeholder="Button on the right").form-control
  button.btn.btn-primary(type="button") Button

// Dropdown addon on the left
.input-group
  button(type="button", data-bs-toggle="dropdown").btn.btn-primary.dropdown-toggle Dropdown
  .dropdown-menu.my-1
    a.dropdown-item(href="#") Action
    a.dropdown-item(href="#") Another action
    a.dropdown-item(href="#") Something else here
  input(type="text", placeholder="Dropdown on the left").form-control

// Dropdown addon on the right
.input-group
  input(type="text", placeholder="Dropdown on the right").form-control
  button.btn.btn-primary.dropdown-toggle(type="button", data-bs-toggle="dropdown") Dropdown
  .dropdown-menu.dropdown-menu-end.my-1
    a.dropdown-item(href="#") Action
    a.dropdown-item(href="#") Another action
    a.dropdown-item(href="#") Something else here

// Multiple button addons
.input-group
  input(type="text", placeholder="Buttons on the right").form-control
  button(type="button").btn.btn-light.border.btn-icon
    i.ai-edit
  button(type="button").btn.btn-white.border.btn-icon
    i.ai-check.text-success
  button(type="button").btn.bg-white.border.btn-icon
    i.ai-trash-2.text-danger

Sizing

<!-- Input group large -->
<div class="input-group input-group-lg">
  ...
</div>

<!-- Input group normal -->
<div class="input-group">
  ...
</div>

<!-- Input group small -->
<div class="input-group input-group-sm">
  ...
</div>
// Input group large
.input-group.input-group-lg
  | ...

// Input group normal
.input-group
  | ...

// Input group small
.input-group.input-group-sm
  | ...
Top