Skip to main content

Text add-ons

prefix and suffix put a short piece of text before or after the field: a currency, a protocol or a unit. The frame draws the border and the focus ring around the input and all its extras.

$ USD
https://
kg

Icons

leading-icon and trailing-icon take full Font Awesome classes. Icons are decorative and hidden from assistive tech, so the label or the help text must carry the meaning.

This address is verified.

Hint

hint adds a question mark button next to the label that opens a short hint, as on the input.

https:// .example.com

Buttons

A control after the input goes in the trailing slot, such as a search or copy button. It fills the full height of the frame.

With select

A plain select in the leading slot, styled to sit inside the frame. It needs its own aria-label because the visible label belongs to the input.

Range

A minimum and a maximum are not an input group: use two inputs inside a fieldset named by its legend. Each input needs its own aria-label.

Price range

Password

password adds a lock icon and a button that shows or hides the text. The button keeps one label, "Show password", and tells assistive tech its state with aria-pressed. strength adds a strength meter and its text, read out with aria-live. The aside slot puts content on the label row, such as a "Forgot password?" link.

Password strength:

Use 8 or more characters with upper and lower case letters, a number and a symbol.

Sizes

Three sizes: small, medium and large. Medium is 40 px high, the same as the input and a medium button. The add-ons stretch to the height of the input.

$ USD
$ USD
$ USD

States

disabled and readonly go to the input. A disabled input is dimmed and skipped by the keyboard.

$
$

Validation

Constraint attributes such as required and type="email" let the browser check the value when the form is sent. error shows a message at once and turns the frame red, for an error the server returns.

Use an address like name@example.com.

@

This username is already taken.