Ballmac UI home

Input

A text input in three heights that match Button, plus InputGroup and InputGroupAddon for leading or trailing icons, units and domains.

Installation

$ pnpm dlx shadcn@latest add @ballmac/input

Usage

import { Input, InputGroup, InputGroupAddon } from "@/components/ballmac/input"

The full example is in the Code tab above.

Examples

With icon and suffix

Invalid

Enter a full email address, like alex@acme.com.

API reference

<Input>

PropTypeDefault
htmlSize

Native `size` attribute (visible character width). `size` is the height variant.

number—
size"sm" | "default" | "lg""default"

<InputGroup>

PropTypeDefault
size"sm" | "default" | "lg""default"

<InputGroupAddon>

PropTypeDefault
align

Which side of the input the addon sits on (visual order; keep markup order the same for screen readers).

"start" | "end""start"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabMoves focus to the input
Click on an addonFocuses the input

Use with AI

Single-line text field. Use size to match neighbouring buttons, wrap in InputGroup with InputGroupAddon (align start or end) for icons or text like ".com", and set aria-invalid for error styling. With the shadcn MCP server set up (guide), ask your agent:

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

Use it for

  • Any single-line form field (email, name, URL, search)
  • Search boxes with a leading icon
  • Fields with a fixed unit or domain suffix

Not for

  • Multi-line text (use textarea)
  • Choosing from a fixed list (use select)
  • On/off settings (use switch or checkbox)

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

Credits

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

Registry
shadcn/utils