Label
Styled label with optional form control wrapping. Standalone mode renders colored uppercase text. Wrapper mode (via label prop) renders the label above or beside children content.
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
Wrapper
Horizontal
Colors
Disabled
API Reference
Label
Accessibility
Notes
Standalone vs Wrapper Mode
Without the label prop, Label renders as a simple styled <label> with colored uppercase text. With the label prop, it wraps children in a flex container — the label becomes a <span> above (or beside) the child content.
Orientation
In wrapper mode, orientation controls layout direction. Vertical (default) stacks the label above children with a small gap. Horizontal places them side-by-side, useful for checkbox-style layouts.
Native Label Wrapping
Wrapper mode uses native label wrapping, which only associates text with labelable descendants such as input, textarea, and select. Div-based Checkbox and Radio controls are not labelable through the wrapper; pass their own label prop instead.
Disabled State
Wrapper mode automatically resolves the muted token when it contains a disabled form control, and marks GrayText in forced-colors mode. Standalone mode does not inspect sibling controls; apply any disabled appearance explicitly through className.
Source
Install via CLI: pnpm exec dgadd add ui/label.
Highlighted source loads after this disclosure opens. Browse the source repository.