Utils
Dependency-light helpers the UI primitives build on — ref composition, selectable-item collections, and shadcn namespace interop.
Shared, dependency-light utilities the components build on. Each is copyable through dgadd or the shadcn CLI and importable from the package; you own the copied source.
Documented utilities
Installing
Before publication: Diffgazer packages are not yet published to npm, so there is no dgadd bin until you install one. Follow the canonical Copy-first mode procedure to build and pack @diffgazer/add, then install that packed tarball in the target app. The target-app install is what puts dgadd on pnpm exec.
composeRefs and selectable-collection install like any other item, into lib/. composeRefs is a single lib/compose-refs.ts; selectable-collection writes three files — lib/selectable-collection.ts, lib/selectable-collection-observer.ts, and lib/selectable-group.ts — and additionally resolves the @diffgazer-keys/focusable registry item.
They are also pulled in automatically when you add a component that depends on them — composeRefs ships with select, menu, tabs, radio, checkbox, navigation-list, and command-palette.
Import from the copied source, or from the package in package mode:
Other registry utilities
The registry ships more registry:lib helpers without standalone pages here. They install the same way (dgadd add ui/<name>) and come along with the components that use them:
utils—cn()class-name merge (clsx+tailwind-merge), imported by every component.aria,typeahead,search— ARIA and keyboard-interaction helpers shared across form and listbox composites.focus-outline,marker-rail— the keyboard-focus outline and the selected-row left rail as plain class-name constants, so every component draws the same two marks. Importable from the package as@diffgazer/ui/lib/focus-outlineand@diffgazer/ui/lib/marker-rail.selectable-variants,segmented-variants,input-variants,stepper-variants— CVA variant definitions that live in the sharedregistry/lib/directory. See Variants for which components consume each.sidebar-variants— aregistry:uiitem, notregistry:lib: its CVA definitions are colocated inregistry/ui/sidebar/because onlySidebaruses them.