ShtukbaseStandard
package page→ /design/keer-ui.md

pages/design/keer-ui.md

60 lines, 3.5 KB. As a page.

  1. ---
  2. type: Page
  3. title: "The keer-ui component library"
  4. 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."
  5. icon: "🧩"
  6. target: src/ui
  7. tokens: design/keer-style/tokens.css
  8. ---
  9. # The keer-ui component library
  10. 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).
  11. ## How it works
  12. 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.
  13. - 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.
  14. - 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`.
  15. - Next to the code lies `.keer-ui.json`: what is placed and with what hash.
  16. - 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`.
  17. What is in the folder:
  18. | Folder | What |
  19. |---|---|
  20. | `primitives/` | the shadcn base on Base UI |
  21. | `composites/` | composites made of primitives |
  22. | `lib/define.ts` | the component contract: `defineComponent`, `defineStates` |
  23. | `lib/utils.ts` | `cn`, class merging that respects text styles |
  24. | `hooks/use-mobile.ts` | a narrow window, for the sidebar |
  25. | `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 |
  26. Every component has `<name>.states.tsx`: meta and states on demo data.
  27. ## What the project needs
  28. The package does not install dependencies. The project installs them itself:
  29. - `react` and `react-dom` ^19;
  30. - `@base-ui/react` ^1.9, the base of the primitives;
  31. - `class-variance-authority` ^0.7, variants;
  32. - `cn` ^0.5, class merging;
  33. - `lucide-react`, icons;
  34. - `sonner` ^2 and `next-themes` ^0.4, only for notifications (`primitives/sonner.tsx`);
  35. - `tailwindcss` ^4, `@tailwindcss/postcss` (or the Vite plugin), `tw-animate-css` ^1.4, `shadcn` ^4 (it provides `shadcn/tailwind.css`);
  36. - TypeScript with `jsx: react-jsx`.
  37. 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).
  38. ## Norms
  39. - [KU-R01](/norms/rules/keer-ui/KU-R01.md): the library is intact: files in place, imports find their files.
  40. - [KU-R02](/norms/rules/keer-ui/KU-R02.md): a component has a states file.
  41. The library code is also held to the `keer-style` style norms: color, corner radius and shadow only from tokens.
  42. ## Source
  43. 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.