Input
Terminal-styled text input primitives with size variants, invalid state, and optional prefix/suffix grouping.
Sizes sm and md are desktop densities (28/36px tall; the tap target spans the full row width and meets WCAG 2.5.8 AA). On coarse-pointer/mobile-first forms prefer size="lg" (44px).
Installation
dgadd ships in @diffgazer/add on npm: pnpm add -D @diffgazer/add puts it on pnpm exec, and npx @diffgazer/add runs it without the install.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS from the installed package.
Usage
Examples
Group
Variants
Focus
Form
API Reference
Input
InputGroup
Accessibility
Notes
Read-only vs Disabled
Input styles the two states on different channels so they cannot be confused. Disabled dashes the border and dims the ink: the field is not part of this form. Read-only fills the surface with the recessed token and keeps full-contrast ink: the value matters, it just cannot be edited. A read-only field stays focusable and copyable, and the focus ring still applies on top of the fill because one is an edge and the other a surface.
Invalid State
Set aria-invalid=true on Input or InputGroup to apply the error border. The error ring joins on focus, so focus stays the strongest edge a field shows. Field.Control sets aria-invalid automatically when Field.invalid is true.
InputGroup
Use InputGroup for prefix and suffix content around a text input. Plain text and number affixes are decorative by default; set prefixAriaHidden or suffixAriaHidden to false when that text contributes meaning. Non-text affixes remain exposed by default and can be hidden explicitly. Interactive affixes must remain exposed and provide their own accessible labels. Use Field when you need label, description, and error wiring.
Source
Install via CLI: pnpm exec dgadd add ui/input.
Highlighted source loads after this disclosure opens. Browse the source repository.