Core Components

Input Group

Add addons, buttons, and helper content to inputs.

12 results
import { MagnifyingGlassIcon } from "@phosphor-icons/react"
import {
  InputGroup,
  InputGroupAddon,
  InputGroupInput,
} from "@/components/ui/input-group"

export function InputGroupDemo() {
  return (
    <InputGroup className="max-w-xs">
      <InputGroupInput placeholder="MagnifyingGlassIcon..." />
      <InputGroupAddon>
        <MagnifyingGlassIcon />
      </InputGroupAddon>
      <InputGroupAddon align="inline-end">12 results</InputGroupAddon>
    </InputGroup>
  )
}

Installation

Install with the shadcn CLI. An AI assistant with the shadcn MCP server configured can also install components automatically when you ask for them (see Getting Started).

npx shadcn@latest add input-group

Documentation

For all options, variants and the full API, see the shadcn/ui docs.

Last updated on

On this page