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">
  <span class="input-group-text">
    <i class="fi-lock"></i>
  </span>
  <input type="password" class="form-control" placeholder="Password">
</div>

<!-- Addon on the right -->
<div class="input-group">
  <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">
  <span class="input-group-text fs-lg py-1">$</span>
  <input type="text" class="form-control" placeholder="Amount">
  <span class="input-group-text">.00</span>
</div>

Different addon types

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

<!-- Textual addon -->
<div class="input-group">
  <span class="input-group-text fw-bold text-dark">Options</span>
  <select class="form-select">
    <option>Choose one...</option>
    <option>One</option>
    <option>Two</option>
    <option>Three</option>
  </select>
</div>

<!-- Checkbox addon -->
<div class="input-group">
  <div class="input-group-text py-1 pe-2">
    <div class="form-check">
      <input class="form-check-input" type="checkbox" id="ex-check-1">
      <label class="form-check-label" for="ex-check-1"></label>
    </div>
  </div>
  <input class="form-control" type="text" placeholder="Checkbox here">
</div>

<!-- Radio button addon -->
<div class="input-group">
    <div class="input-group-text py-1 pe-2">
      <div class="form-check">
        <input class="form-check-input" type="radio" id="ex-radio-1" name="radio">
        <label class="form-check-label" for="ex-radio-1"></label>
      </div>
    </div>
  <input class="form-control" type="text" placeholder="Radio button here">
</div>

Multiple inputs

Full name
<!-- Multiple inputs (addon on the left) -->
<div class="input-group">
  <span class="input-group-text fw-bold text-dark">Full 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="fi-clock"></i>
  </span>
</div>

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" ngbDropdown >
  <button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" ngbDropdownToggle>Dropdown</button>
  <div class="dropdown-menu my-1" ngbDropdownMenu >
    <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" ngbDropdown>
  <input class="form-control" type="text" placeholder="Dropdown on the right">
  <button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" ngbDropdownToggle>Dropdown</button>
  <div class="dropdown-menu dropdown-menu-end my-1" ngbDropdownMenu >
    <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 icon link addons -->
<div class="input-group">
  <input class="form-control" type="text" placeholder="Icon links on the right">
  <div class="input-group-text p-0">
    <a class="d-block text-body px-3 py-2" href="#">
      <i class="fi-edit mt-n1"></i>
    </a>
  </div>
  <div class="input-group-text p-0">
    <a class="d-block text-success px-3 py-2" href="#">
      <i class="fi-check mt-n1"></i>
    </a>
  </div>
  <div class="input-group-text p-0">
    <a class="d-block text-danger px-3 py-2" href="#">
      <i class="fi-trash mt-n1"></i>
    </a>
  </div>
</div>

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>
Top