# Input Group

> Input with prefix and suffix addons.

Registry name: `input-group`. HTML docs: https://ui.anuragroy.dev/component/input-group.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/input-group.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/input-group.json`.

Registry JSON: https://ui.anuragroy.dev/r/input-group.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/input-group.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

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

## Usage

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

export function Example() {
  return (
    <InputGroup>
      <InputGroupAddon>
        <InputGroupText>https://</InputGroupText>
      </InputGroupAddon>
      <InputGroupInput placeholder="example.com" />
      <InputGroupAddon align="end">
        <InputGroupButton aria-label="Go">→</InputGroupButton>
      </InputGroupAddon>
    </InputGroup>
  )
}
```

## API

### InputGroupAddon

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `align` | "start" \| "end" | "start" |  |

## Notes

- Put the actual control in `InputGroupInput`, not a raw `Input`.

## See also

- [HTML page](https://ui.anuragroy.dev/component/input-group): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/input-group.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
