# Input: With a button

> Side by side with a gap, or joined into one control inside a `<ButtonGroup />`, where the input takes the remaining width.

Example: https://hextaui.com/docs/input/examples/with-button
Component docs: https://hextaui.com/docs/input.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/input-with-button.json
```

This adds `components/examples/input/with-button.tsx` with the Input component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/input/with-button.tsx"
import { Button } from "@/components/ui/button"
import { ButtonGroup } from "@/components/ui/button-group"
import { Input } from "@/components/ui/input"

export function InputWithButton() {
  return (
    <form className="flex w-full max-w-sm flex-col gap-4">
      <div className="flex gap-2">
        <Input type="email" aria-label="Email" placeholder="you@example.com" />
        <Button type="submit">Subscribe</Button>
      </div>
      <ButtonGroup className="w-full">
        <Input type="search" aria-label="Search" placeholder="Search…" />
        <Button variant="outline">Search</Button>
      </ButtonGroup>
    </form>
  )
}
```

## Props in this example

### Input

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `type` | `string` | `"text"` |  |

## More Input examples

- [Sizes](https://hextaui.com/docs/input/examples/sizes.md)
- [With a description](https://hextaui.com/docs/input/examples/description.md)
- [Invalid](https://hextaui.com/docs/input/examples/invalid.md)
- [Native validation](https://hextaui.com/docs/input/examples/native-validation.md)
- [Disabled](https://hextaui.com/docs/input/examples/disabled.md)
- [Read only](https://hextaui.com/docs/input/examples/read-only.md)
- [File](https://hextaui.com/docs/input/examples/file.md)
- [Input types](https://hextaui.com/docs/input/examples/types.md)
- [Controlled](https://hextaui.com/docs/input/examples/controlled.md)
- [Grid](https://hextaui.com/docs/input/examples/grid.md)
- [Long content](https://hextaui.com/docs/input/examples/long-content.md)
- [Right to left](https://hextaui.com/docs/input/examples/rtl.md)
