Input

Component

Input

A soft field. The label rests on the text line, then rises once you focus or type.

Classes

ClassType
inputComponentThe label that wraps the field.
input-smSizeSmall.
input-lgSizeLarge.
input-startPartAn icon before the text. It centers on one line.
input-endPartAn icon after the text.
primaryColorIndigo by default.
secondaryColorPink by default.
tertiaryColorTeal by default.
neutralColorGray by default. Used when you set no color.
successColorGreen by default.
errorColorRed by default.
warningColorAmber by default.
infoColorSky by default.

Field

The placeholder is a single space. That is how the label knows the field is empty. The span is the label.

<label class="input">
  <input placeholder=" ">
  <span>Email</span>
</label>

Colors

<label class="input primary">
  <input placeholder=" " value="Primary">
  <span>Primary</span>
</label>
<label class="input secondary">
  <input placeholder=" " value="Secondary">
  <span>Secondary</span>
</label>
<label class="input tertiary">
  <input placeholder=" " value="Tertiary">
  <span>Tertiary</span>
</label>
<label class="input neutral">
  <input placeholder=" " value="Neutral">
  <span>Neutral</span>
</label>
<label class="input success">
  <input placeholder=" " value="Success">
  <span>Success</span>
</label>
<label class="input error">
  <input placeholder=" " value="Error">
  <span>Error</span>
</label>
<label class="input warning">
  <input placeholder=" " value="Warning">
  <span>Warning</span>
</label>
<label class="input info">
  <input placeholder=" " value="Info">
  <span>Info</span>
</label>

Sizes

<label class="input input-sm">
  <input placeholder=" ">
  <span>Small</span>
</label>

Icons

The text and the label indent to clear the icons.

<label class="input">
  <span class="input-start" aria-hidden="true"><svg><!-- search --></svg></span>
  <input placeholder=" ">
  <span>Search</span>
  <span class="input-end" aria-hidden="true"><svg><!-- send --></svg></span>
</label>

With a message

Use a work address.

<label class="input error">
  <input placeholder=" ">
  <span>Email</span>
</label>
<p class="message">Use a work address.</p>

No color class means neutral. While the field is empty and not focused, the label is large and dim, on the text line. Focus, or the first letter, shrinks it to a caption and the caret is already where the letters go.