Skip to content

Input Group

<div class="input-group">
<span class="input-group-addon"></span>
<input class="input input-group-control" aria-label="Search" />
</div>

The group owns the border and the focus ring; the control inside gives up its own, so there is one edge rather than two boxes nested inside each other.

ClassPart
.input-groupThe bordered box
.input-group-controlThe input or textarea inside it
.input-group-addonAnything alongside the control
.input-group-textMuted text inside an addon
AttributeOn the addonMeaning
(none) or data-align="inline-start"leading edgeBefore the control
data-align="inline-end"trailing edgeAfter the control
data-align="block-start"aboveA full-width row on top
data-align="block-end"belowA full-width row underneath
partialkit.dev/
K

A block-end addon puts the actions under the control, and the group grows to fit.

Set dir="rtl" on the page or on any subtree — inline-start and inline-end follow the reading direction, which is why they are named that way rather than left and right. See the button page for a live example.

  • The control still needs a name. The addon is not a label — an icon beside a field says nothing. Use <label for>, or aria-label when there is no visible text.
  • A unit is not a label either. In partialkit.dev/[docs], the prefix is context; the field still needs to say what it is.
  • The group is not focusable, only the control inside it is. The ring appears on the group because that is the visible box, but focus never lands on a <div>.