Input Group

A text field with icons, text or buttons inside it.

@cupertinoui/input-groupRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/input-group

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import { InputGroup, InputGroupAddon, InputGroupInput } from "@/components/ui/input-group"

<InputGroup>
  <InputGroupAddon><SearchIcon /></InputGroupAddon>
  <InputGroupInput placeholder="Search" />
</InputGroup>

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

InputGroupAddon

PropTypeDescription
align"inline-start" | "inline-end" | "block-start" | "block-end"
Default: "inline-start"
Where the addon sits.
classNamestringExtra classes, merged with the component's own.

InputGroupButton

PropTypeDescription
size"xs" | "sm" | "icon-xs" | "icon-sm"
Default: "xs"
A small button that fits inside the field.
classNamestringExtra classes, merged with the component's own.

InputGroupInput / InputGroupTextarea / InputGroupText

PropTypeDescription
classNamestringExtra classes, merged with the component's own.