package page→ /design/keer-ui.md
pages/design/keer-ui.md
60 lines, 3.5 KB. As a page.
- ---
- type: Page
- title: "The keer-ui component library"
- description: "React + Tailwind components in the keer-style style: the code is placed in the project, as with shadcn. Where it lives, what the project needs, how to update."
- icon: "🧩"
- target: src/ui
- tokens: design/keer-style/tokens.css
- ---
- # The keer-ui component library
- 56 components from an earlier product that suit use outside it: 35 primitives (a button, a field, a card, a table, a menu, a dialog, tabs, a sidebar…) and 21 composites (a page header, a two-column layout, a state view, lists, badges). There are no domain components here (leads, tenders, sites, the copilot queue). The list with states is in the [catalog](keer-ui/catalog.html).
- ## How it works
- As with shadcn: the package does not install an npm dependency but copies sources into the project. The code becomes the project's code, and it can be edited.
- - The folder is the `target:` field of this page (now `src/ui`). If you change it, run `shtuk run keer-ui place`: the library will be placed in the new folder.
- - The tokens file is the `tokens:` field (by default from the `keer-style` package). The path to it is written in the `@import` of the file `styles/keer-ui.css`.
- - Next to the code lies `.keer-ui.json`: what is placed and with what hash.
- - A package update places the new version over untouched files. Files the project edited stay as they are; `place` names them. To replace those too: `shtuk run keer-ui place --force`.
- What is in the folder:
- | Folder | What |
- |---|---|
- | `primitives/` | the shadcn base on Base UI |
- | `composites/` | composites made of primitives |
- | `lib/define.ts` | the component contract: `defineComponent`, `defineStates` |
- | `lib/utils.ts` | `cn`, class merging that respects text styles |
- | `hooks/use-mobile.ts` | a narrow window, for the sidebar |
- | `styles/keer-ui.css` | the Tailwind theme and the map of shadcn roles on tokens; `typography.css` is text styles; `frame.css` is the frame |
- Every component has `<name>.states.tsx`: meta and states on demo data.
- ## What the project needs
- The package does not install dependencies. The project installs them itself:
- - `react` and `react-dom` ^19;
- - `@base-ui/react` ^1.9, the base of the primitives;
- - `class-variance-authority` ^0.7, variants;
- - `cn` ^0.5, class merging;
- - `lucide-react`, icons;
- - `sonner` ^2 and `next-themes` ^0.4, only for notifications (`primitives/sonner.tsx`);
- - `tailwindcss` ^4, `@tailwindcss/postcss` (or the Vite plugin), `tw-animate-css` ^1.4, `shadcn` ^4 (it provides `shadcn/tailwind.css`);
- - TypeScript with `jsx: react-jsx`.
- Connecting the styles is one line in the application's main CSS: `@import "./ui/styles/keer-ui.css";` (the path from your file to the `target` folder).
- ## Norms
- - [KU-R01](/norms/rules/keer-ui/KU-R01.md): the library is intact: files in place, imports find their files.
- - [KU-R02](/norms/rules/keer-ui/KU-R02.md): a component has a states file.
- The library code is also held to the `keer-style` style norms: color, corner radius and shadow only from tokens.
- ## Source
- An earlier product, `packages/ui/src` as of 28.11.2026: `primitives/`, `composites/`, `lib/define.ts`, `lib/utils.ts`, `hooks/use-mobile.ts`, `styles/globals.css`, `typography.css`, `frame.css`. Imports `@copilot/ui/…` were rewritten as relative ones. The demo data of the states was cleared of domain words. Two corner radii in pixels (`checkbox`, `tooltip`) are written through a token, with the same pixels. Tests (vitest) and the registry were not carried over.