Extend form controls by adding text or buttons before, after, or on both sides of any text-based input. Use `.input-group` with an `.input-group-addon` to prepend or append elements to a single `.form-control`.
<pclass="lead">Extend form controls by adding text or buttons before, after, or on both sides of any text-based input. Use <code>.input-group</code> with an <code>.input-group-addon</code> to prepend or append elements to a single <code>.form-control</code>.</p>
<divclass="bs-callout bs-callout-danger">
<h4>Cross-browser compatibility</h4>
<p>Avoid using <code><select></code> elements here as they cannot be fully styled in WebKit browsers.</p>
</div>
<divclass="bs-callout bs-callout-warning">
<h4>Tooltips & popovers in input groups require special setting</h4>
<p>When using tooltips or popovers on elements within an <code>.input-group</code>, you'll have to specify the option <code>container: 'body'</code> to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).</p>
</div>
<divclass="bs-callout bs-callout-warning">
<h4>Don't mix with other components</h4>
<p>Do not mix form groups or grid column classes directly with input groups. Instead, nest the input group inside of the form group or grid-related element.</p>
</div>
<divclass="bs-callout bs-callout-danger">
<h4>Cross-browser compatibility</h4>
<p>Avoid using <code><select></code> elements here as they cannot be fully styled in WebKit browsers.</p>
</div>
<divclass="bs-callout bs-callout-warning">
<h4>Tooltips & popovers in input groups require special setting</h4>
<p>When using tooltips or popovers on elements within an <code>.input-group</code>, you'll have to specify the option <code>container: 'body'</code> to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).</p>
</div>
<divclass="bs-callout bs-callout-warning">
<h4>Don't mix with other components</h4>
<p>Do not mix form groups or grid column classes directly with input groups. Instead, nest the input group inside of the form group or grid-related element.</p>
</div>
## Basic example
Place one add-on or button on either side of an input. You may also place one on both sides of an input.
<h2id="input-groups-basic">Basic example</h2>
<p>Place one add-on or button on either side of an input. You may also place one on both sides of an input.</p>
<p><strongclass="text-danger">We do not support multiple add-ons on a single side.</strong></p>
<p><strongclass="text-danger">We do not support multiple form-controls in a single input group.</strong></p>
<p>Add the relative form sizing classes to the <code>.input-group</code> itself and contents within will automatically resize—no need for repeating the form control size classes on each element.</p>
Add the relative form sizing classes to the `.input-group` itself and contents within will automatically resize—no need for repeating the form control size classes on each element.
Place any checkbox or radio option within an input group's addon instead of text.
<h2id="input-groups-checkboxes-radios">Checkboxes and radio addons</h2>
<p>Place any checkbox or radio option within an input group's addon instead of text.</p>
<formclass="bs-example bs-example-form">
<divclass="row">
<divclass="col-lg-6">
<divclass="input-group">
<spanclass="input-group-addon">
<inputtype="checkbox">
</span>
<inputtype="text"class="form-control">
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
<divclass="col-lg-6">
<divclass="input-group">
<spanclass="input-group-addon">
<inputtype="radio">
</span>
<inputtype="text"class="form-control">
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
</div><!-- /.row -->
</form>
{% highlight html %}
{% example html %}
<divclass="row">
<divclass="col-lg-6">
<divclass="input-group">
...
...
@@ -127,43 +77,24 @@ title: Input group
<inputtype="checkbox">
</span>
<inputtype="text"class="form-control">
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
</div>
</div>
<divclass="col-lg-6">
<divclass="input-group">
<spanclass="input-group-addon">
<inputtype="radio">
</span>
<inputtype="text"class="form-control">
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
</div><!-- /.row -->
{% endhighlight %}
</div>
</div>
</div>
{% endexample %}
## Button addons
<h2id="input-groups-buttons">Button addons</h2>
<p>Buttons in input groups are a bit different and require one extra level of nesting. Instead of <code>.input-group-addon</code>, you'll need to use <code>.input-group-btn</code> to wrap the buttons. This is required due to default browser styles that cannot be overridden.</p>
Buttons in input groups are a bit different and require one extra level of nesting. Instead of `.input-group-addon`, you'll need to use `.input-group-btn` to wrap the buttons. This is required due to default browser styles that cannot be overridden.