Input group

Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.


Styles

Default

@
@example.com
<div class="form-group">
    <div class="input-group">
        <div class="input-group-prepend">
            <span class="input-group-text" id="basic-addon1">@</span>
        </div>
        <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
    </div>
</div>

<div class="form-group">
    <div class="input-group">
      <input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="basic-addon2">
      <div class="input-group-append">
        <span class="input-group-text" id="basic-addon2">@example.com</span>
      </div>
    </div>
</div>

Merged

You can choose to merge input group elements by removing the border between them using the .input-group-merge modifier class.

@
@
@example.com
<div class="form-group">
    <div class="input-group input-group-merge rounded-pill">
        <input type="text" class="form-control form-control-prepend" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
        <div class="input-group-prepend">
            <span class="input-group-text" id="basic-addon1">@</span>
        </div>
    </div>
</div>
<div class="form-group">
    <div class="input-group input-group-merge rounded-pill">
        <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
        <div class="input-group-append">
            <span class="input-group-text" id="basic-addon1">@</span>
        </div>
    </div>
    </div>
<div class="form-group">
    <div class="form-group">
        <div class="input-group input-group-merge">
          <input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="basic-addon2">
          <div class="input-group-append">
            <span class="input-group-text" id="basic-addon2">@example.com</span>
          </div>
        </div>
    </div>
</div>