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 is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.
The hosted registry is not public yet because r.b4r7.dev does not resolve. Use this source checkout or a local registry preview until the endpoint returns 200.
Diffgazer packages are not yet published to npm. Until the first release, pack @diffgazer/ui and @diffgazer/keys from the repository and install those tarballs.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.
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.