Ballmac UI home

Input Group

One bordered field that wraps an input or textarea with icon, text, button and keyboard-hint addons at either end or above and below.

12 results
https://
.example.com

Installation

$ pnpm dlx shadcn@latest add @ballmac/input-group

Usage

import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea } from "@/components/ballmac/input-group"

The full example is in the Code tab above.

Examples

Invalid and disabled

API reference

<InputGroup>

PropTypeDefault
"aria-label"

Accessible name for the group, for example "Website address".

string—

<InputGroupAddon>

PropTypeDefault
align

Where the addon sits. Inline addons flank the control; block addons stack above or below it (for textareas).

"inline-start" | "inline-end" | "block-start" | "block-end""inline-start"
align"inline-start" | "inline-end" | "block-start" | "block-end""inline-start"

<InputGroupButton>

PropTypeDefault
size"xs" | "sm" | "icon-xs" | "icon-sm""xs"
variant"ghost" | "secondary" | "default""ghost"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Click addon textFocuses the control
TabMoves between the control and addon buttons

Use with AI

Put InputGroupInput or InputGroupTextarea plus InputGroupAddon parts inside InputGroup. The group draws the border, focus ring and invalid state. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Input Group (@ballmac/input-group) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • URL and currency prefixes and suffixes
  • Search fields with a button
  • Chat composers with a send button

Not for

  • A plain field; use input
  • Attached separate buttons; use button-group

Registry JSON: https://ui.ballmac.com/r/input-group.json

Credits

Based on shadcn/ui Input Group, adapted by Ballmac. Free to use in personal and commercial projects.

Registry
shadcn/utils