Skip to content

shadcn.io is not affiliated with official shadcn/ui

Shadcn Input Group for React

Group input elements together.

12 results

Installation

bunx --bun shadcn@latest add https://kit.dev/r/aria/input-group.json

Usage

import { SearchIcon } from "lucide-react";
import {
  InputGroup,
  InputGroupAddon,
  InputGroupInput,
} from "@/components/ui/input-group";
<InputGroup className="max-w-xs">
  <InputGroupInput placeholder="Search..." />
  <InputGroupAddon>
    <SearchIcon aria-hidden="true" />
  </InputGroupAddon>
  <InputGroupAddon align="inline-end">12 results</InputGroupAddon>
</InputGroup>

Accessibility

KeyDescription
Enter
Activate the focused control.
Space
Activate the focused control.

Demos

Inline Start

Use align="inline-start" to position the addon at the start of the input.

Inline End

Use align="inline-end" to position the addon at the end of the input.

Block Start

Use align="block-start" to position the addon above the input.

Block End

Use align="block-end" to position the addon below the input.

Icon

Icons inside input group addons.

Text

Text addons for currency, URLs, and character counts.

Button

Buttons inside input group addons, including copy and popover actions.

Kbd

Keyboard shortcut hint with Kbd in an addon.

Menu actions inside input group addons.

Spinner

Loading spinners inside input group addons.

Textarea

Textarea with block-start and block-end addons.

Custom

Custom control with data-slot="input-group-control" for focus styles.

Rtl

Right-to-left input group. See the RTL configuration guide for document direction.

API Reference

InputGroup

PropType
AttributeType

InputGroupAddon

PropType
AttributeType

InputGroupButton

PropType
AttributeType

InputGroupText

PropType
AttributeType

InputGroupInput

PropType
AttributeType

InputGroupTextarea

PropType
AttributeType