TypeScript
Configure path aliases, strict mode, and the React version for @diffgazer/ui.
@diffgazer/ui components are written in TypeScript and require path alias configuration.
Path aliases
Components import through the source alias recorded by dgadd init. Configure a root source alias such as @/* or ~/* in tsconfig.json:
And mirror it in vite.config.ts:
dgadd init writes the aliases it will use into diffgazer.json, but it does not mutate tsconfig.json, jsconfig.json, Vite, Next.js, or other bundler config. Add the app-level source alias yourself before building copied components.
For Next App Router, configure the same source alias path in tsconfig.json or jsconfig.json. Keep global CSS imports in app/layout.tsx through your app CSS entrypoint; copied component files must not import global CSS directly.
Strict mode
Components are written with strict: true. We recommend enabling it:
React
@diffgazer/ui targets React >=19.2.0. Ensure your project uses a compatible version:
Components follow React >=19.2.0 hook semantics and use memoization hooks only where stable callback identity is part of the component contract.
Where to go next
- Installation — add components with
dgadd - Tailwind Setup — theme tokens and CSS entrypoint