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">
  <div class="input-group-prepend">
    <span class="input-group-text">
      <i class="fe-lock"></i>
    </span>
  </div>
  <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">
  <div class="input-group-append">
    <span class="input-group-text">@example.com</span>
  </div>
</div>

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

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

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

Different types

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

<!-- Textual addon -->
<div class="input-group">
  <div class="input-group-prepend">
    <span class="input-group-text font-weight-medium">Options</span>
  </div>
  <select class="form-control custom-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-prepend">
    <div class="input-group-text">
      <div class="custom-control custom-checkbox">
        <input class="custom-control-input" type="checkbox" id="ex-check-1">
        <label class="custom-control-label" for="ex-check-1"></label>
      </div>
    </div>
  </div>
  <input class="form-control" type="text" placeholder="Checkbox here">
</div>

<!-- Radio button addon -->
<div class="input-group">
  <div class="input-group-prepend">
    <div class="input-group-text">
      <div class="custom-control custom-radio">
        <input class="custom-control-input" type="radio" id="ex-radio-1" name="radio">
        <label class="custom-control-label" for="ex-radio-1"></label>
      </div>
    </div>
  </div>
  <input class="form-control" type="text" placeholder="Radio button here">
</div>
// Icon addon
.input-group
  .input-group-prepend
    span.input-group-text
      i.fe-message-square
  textarea(placeholder="Type your message here...", rows="6").form-control

// Textual addon
.input-group
  .input-group-prepend
    span.input-group-text.font-weight-medium
      | Options
  select.form-control.custom-select
    option Choose one...
    option One
    option Two
    option Three
    option Four
    option Five

// Checkbox addon
.input-group.form-group
  .input-group-prepend
    .input-group-text
      .custom-control.custom-checkbox
        input(type="checkbox", id="ex-check-1").custom-control-input
        label(for="ex-check-1").custom-control-label
  input(type="text", placeholder="Checkbox here").form-control

// Radio button addon
.input-group.form-group
  .input-group-prepend
    .input-group-text
      .custom-control.custom-radio
        input(type="radio", id="ex-radio-1", name="radio").custom-control-input
        label(for="ex-radio-1").custom-control-label
  input(type="text", placeholder="Radio button here").form-control

Multiple inputs

First & last name
<!-- Multiple inputs (addon on the left) -->
<div class="input-group">
  <div class="input-group-prepend">
    <span class="input-group-text text-heading font-weight-medium">First &amp; last name</span>
  </div>
  <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">
  <div class="input-group-append">
    <span class="input-group-text">
      <i class="fe-clock"></i>
    </span>
  </div>
</div>
// Multiple inputs (addon on the left)
.input-group
  .input-group-prepend
    span.input-group-text.text-heading.font-weight-medium 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
  .input-group-append
    span.input-group-text
      i.fe-clock

Button addons

<!-- Button addon on the left -->
<div class="input-group">
  <div class="input-group-prepend">
    <button class="btn btn-primary" type="button">Button</button>
  </div>
  <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">
  <div class="input-group-append">
    <button class="btn btn-primary" type="button">Button</button>
  </div>
</div>

<!-- Dropdown addon on the left -->
<div class="input-group">
  <div class="input-group-prepend">
    <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown</button>
    <div class="dropdown-menu">
      <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>
  <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">
  <div class="input-group-append">
    <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown</button>
    <div class="dropdown-menu">
      <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>
</div>

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

// Dropdown addon on the left
.input-group
  .input-group-prepend
    button(type="button", data-toggle="dropdown").btn.btn-primary.dropdown-toggle Dropdown
    .dropdown-menu
      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
  .input-group-append
    button.btn.btn-primary.dropdown-toggle(type="button", data-toggle="dropdown") Dropdown
    .dropdown-menu.dropdown-menu-right
      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
  .input-group-append
    button(type="button").btn.btn-light.border.btn-icon
      i.fe-edit
    button(type="button").btn.btn-white.border.btn-icon
      i.fe-check.text-success
    button(type="button").btn.bg-white.border.btn-icon
      i.fe-trash-2.text-danger
Top