Textarea
Terminal-styled multi-line text area with size variants, resize handles that sit outside the scroll area, and a scrollbar that keeps the final line reachable.
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
Resize directions
Variants
Focus
API Reference
Textarea
Accessibility
Notes
Resize Direction
Set resize to "vertical", "horizontal", "both", or "none". The default vertical mode puts a handle on the bottom edge, horizontal puts one on the right edge, and both exposes each edge independently and leaves the corner between them empty. Every handle is a button: drag it, or focus it and press ArrowDown/ArrowUp (vertical) or ArrowRight/ArrowLeft (horizontal) to step by 8px, or press Enter or Space to grow by the same step. Each resizable edge reserves a 16px band outside the field, so the scrollbar stays inside the textarea and can reach the final line.
Resize Handle Style
Pass resizeHandle to choose how each handle is drawn. "line" is a 30px mark centered on the edge and held 10px clear of the field border, so it paints nothing over the field. "box" is a 20px chip carrying only the direction arrow, centered on the field border: the border runs unbroken behind it and half the chip overlaps the field at the edge midpoint. "box-label" is the same chip widened to carry a RESIZE label beside the arrow. Give one value to style both edges, or an object with vertical and horizontal keys to style them independently. The drawing is decorative; the handle button keeps its accessible label and keyboard behavior either way.
Read-only vs Disabled
Textarea styles the two states on different channels so they cannot be confused. Disabled keeps a faint surface, dashed edge, and muted ink: the field is not part of this form. Read-only uses a subtle recessed surface plus an inset start rail while preserving 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. Both states suppress every resize handle.
Invalid State
Set aria-invalid=true 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.
Source
Install via CLI: pnpm exec dgadd add ui/textarea.
Highlighted source loads after this disclosure opens. Browse the source repository.