# Input Group

Add addons, buttons, and helper content to inputs.

Section: Components / Inputs
Page: https://ui.heyramzi.com/components/input-group
Import path: `@heyramzi/ui/shadcn/input-group`

## Import

```ts
import * as InputGroup from "@heyramzi/ui/shadcn/input-group";
```

## Usage

```svelte
<InputGroup.Root>
  <InputGroup.Addon>
    <InputGroup.Text>https://</InputGroup.Text>
  </InputGroup.Addon>
  <InputGroup.Input placeholder="example.com" />
</InputGroup.Root>
```

## Demo

```svelte
<script lang="ts">
	import { MagnifyingGlass } from "phosphor-svelte";
	import * as InputGroup from "@heyramzi/ui/shadcn/input-group";
</script>

<InputGroup.Root class="max-w-xs">
	<InputGroup.Input placeholder="Search..." />
	<InputGroup.Addon>
		<MagnifyingGlass aria-hidden="true" />
	</InputGroup.Addon>
	<InputGroup.Addon align="inline-end">12 results</InputGroup.Addon>
</InputGroup.Root>
```

## API

### InputGroup.Root

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### InputGroup.Input

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` |  | `null` | bindable |
| `value` |  |  | bindable |
| `class` | `string` |  |  |

Every prop of `Input`.

### InputGroup.Addon

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `align` | `"inline-start"` \| `"inline-end"` \| `"block-start"` \| `"block-end"` | `"inline-start"` |  |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### InputGroup.Button

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `size` | `"xs"` \| `"sm"` \| `"icon-xs"` \| `"icon-sm"` | `"xs"` |  |
| `ref` |  | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |
| `type` | `"button" \| "submit" \| "reset"` | `"button"` |  |
| `variant` | `string` | `"ghost"` |  |

Every prop of `Button`, except `href, size`.

### InputGroup.Text

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLSpanElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLSpanElement>` from `svelte/elements`.

### InputGroup.Textarea

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` |  | `null` | bindable |
| `value` |  |  | bindable |
| `class` | `string` |  |  |

Every prop of `Textarea`.
