Input Group

View in Lexicon

A Text Input with added elements that provide a more complex input structure.

installyarn add @clayui/form
versionNPM Version
useimport ClayForm, {ClayInput} from '@clayui/form';

Groups

Clay Input Group markup deviates from Bootstrap 4’s Input Groups.

Example

Snippet

Sizes

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.

Sizing on the individual input group elements isn’t supported.

$
.00
$
.00
$
.00

Snippet

Checkboxes and Radios

Place any checkbox or radio option within an input group’s addon instead of text.

Snippet

Button Addons

Snippet

Multiple Addons

@
.com

Snippet

Separated Addons

@
@
.com

Snippet

Mixed Addons

@

Snippet

Inset

You can insert buttons and links into input group items with the following helper classes: .input-group-inset, .input-group-inset-before, .input-group-inset-after, .input-group-inset-item, .input-group-inset-item-before, and .input-group-inset-item-after. Use the -before classes to inset the button/link at the beginning of the input group, or use the -after classes to inset the button/link at the end of the input group.

To retain the focus styles around the .input-group-inset component when a button or link inside is focused, add the focus class to the .input-group-item. Focus Box Shadows are only supported in .input-group-inset with .input-group-item.focus. .input-prepend and .input-append aren’t supported with .input-group-inset.

Snippet

Password

A pattern for displaying the content inside a password input. Use .input-text-label inside .input-group-inset-item to display specific content for .form-control[type="text"] and .input-password-label for .form-control[type="password"].

This requires custom Javascript to toggle the input type between text and password.

Snippet

Edit this page on GitHub

Contributors

Matuzalém Teles

Last edited May 12, 2025 at 7:56:02 PM