Installation
Initialize a project with dgadd and add @diffgazer/ui components as source.
@diffgazer/ui components install as source files. dgadd copies components and optional @diffgazer/keys hooks into your app and tracks them for later updates.
Installing via dgadd: Components are namespaced (ui/button, ui/dialog). For the full command and flag reference — init, add, list, diff, remove — see the dgadd CLI reference.
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.
Install
With the packed @diffgazer/add tarball installed in the target app, run the installer and add a component:
The one-shot pnpm dlx/npx @diffgazer/add commands become available after the package is published — see Package managers.
Setup
Install Tailwind CSS
@diffgazer/ui source expects Tailwind CSS 4. Install and configure Tailwind before running dgadd init, then import the copied style entry after init writes it.
See Tailwind Setup for framework-specific details.
Configure a source alias
dgadd init requires a TypeScript or Vite source alias such as @/* or ~/*. It rejects projects without one unless --allow-missing-alias is passed for an app whose tooling already resolves source aliases.
Add the alias to TypeScript:
For Vite, mirror the same alias in vite.config.ts:
See TypeScript for framework-specific details.
Initialize
With dgadd available and the source alias in place, run init once and add a component:
This creates diffgazer.json, records the aliases dgadd uses, creates install directories, writes src/lib/utils.ts, and copies src/styles/theme.css plus src/styles/styles.css. It does not edit your TypeScript config, bundler config, or app CSS entrypoint.
Import the component CSS
Import the copied Tailwind/theme entry from your app CSS:
Add components
Add components by namespaced item name. Bare names are rejected:
Keyboard hooks
Standalone hooks can be copied directly:
Components with keyboard behavior choose copy mode or package mode:
copy installs local hook source. keys imports hooks from @diffgazer/keys.
Package managers (future)
Use these one-shot commands only after @diffgazer/add is published:
Result
After adding ui/menu --integration copy, a typical project looks like this:
See Tailwind Setup for theme configuration.