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
npm packages: @diffgazer/add is on npm. pnpm add -D @diffgazer/add puts dgadd on pnpm exec, and npx @diffgazer/add <command> runs it without the install. Components also install without dgadd from the hosted registry: npx shadcn add https://r.b4r7.dev/r/ui/<item>.json.
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.