The Shtukbase React component library
The same components as shtukbase-ui-html in React: the shadcn primitives with our classes and the Shtukbase composites; the code is placed in the project, as with shadcn, and draws with the CSS of the HTML library on the tokens of the chosen style.
About the package
The React side of the Shtukbase design: the same components as shtukbase-ui-html, with the same ids, levels, states and controls, the same markup and the same classes. The look is written once, in the CSS of the HTML library; the React components only draw its classes and data attributes, and add behaviour.
As with shadcn and keer-ui: sources are copied into the project, not installed as a dependency. The place action puts them in the folder from the
target: field of the page /design/shtukbase-ui-react.md (by default src/sb-ui) and runs by itself after install and update. Files the project edited are not touched by an update.
What it puts in the project:
/design/shtukbase-ui-react.md: what is inside, settings (target:,css:), what the project needs;- the library code in the
targetfolder:primitives/,composites/,blocks/,shell/,lib/,styles/index.css; every component has a header (/*--- … ---*/, the one format of the build contract) and a<id>.states.tsx; - norms SBR-R01 (the library is intact), SBR-R02 (a component has a states file), SBR-R03 (the same components as the HTML library).
Components (one per id of shtukbase-ui-html): primitives button, badge, input, select, switch, slider come from shadcn (new-york-v4) with our classes added; the rest of the shadcn set (avatar, checkbox, label, progress, radio-group, separator, skeleton, textarea, tooltip, accordion, alert, breadcrumb, command, dialog, dropdown-menu, popover, table, tabs) has the shadcn names and slots and draws the markup of the HTML library (native inputs, details and plain surfaces, so the HTML side needs no script); chip, icon-plate, kicker, swatches, status-dot, the composites card, package-card, field, record-card, property-row, details-card, empty-state, tree-item, toolbar, search-field, settings-group and the blocks area, package-grid, settings-bar and peek are ours.
The parts in shell/: Sidebar and its parts, Panel, PanelSection, Collapsible, ScrollArea,
Sheet and the layouts LayoutDocument, LayoutGrid, LayoutCatalog, LayoutCanvas (pan, zoom with the wheel and the keys, fit):
plain elements with the classes of shtukbase-ui-html. The lens layout arranges these parts.
The package does not install dependencies (react, radix-ui, class-variance-authority, cn, lucide-react, tailwindcss 4, tw-animate-css); they are requirements for the project, and the list is on the page. The tests carry their own bundled copies (test/vendor) and need no install.
Boundary: no screens and no domain components; the look of our own composites is not repeated in Tailwind classes — it is the CSS of the HTML library. A control of the HTML library is a prop here (preset="cover").
Norms 3
| ID | Norm | Level | Mode | Enforcer |
|---|---|---|---|---|
| SBR-R01 | The React component library is placed in the project: every file of its manifest is in its place and every relative import (code and CSS) finds its file. |
MUST | blocks | check |
| SBR-R02 | Next to every component <id>.tsx in primitives/, composites/ and blocks/ lies <id>.states.tsx, which exports meta and states. |
SHOULD | blocks | check |
| SBR-R03 | Every React component has a valid header whose id is its file name and whose level is its folder; when the project has shtukbase-ui-html, both libraries have the same ids and the same level, controls, states, statuses, uses and parts. |
MUST | blocks | check |
"Blocks": the enforcer stops a violation. "Observes": it only notes it. Level MUST means required; SHOULD means yes by default.
Actions 4
| Name | What it does | File | When |
|---|---|---|---|
| place | Place the library in the project folder (target: on /design/shtukbase-ui-react.md); --force replaces edited files too | actions/place.ts | after install after update |
| library | The library is intact: files in place, imports find their files norm SBR-R01 | checks/library.ts | check |
| states | A component has a states file norm SBR-R02 | checks/states.ts | check |
| same | The same components as the HTML library: valid headers, the same ids, levels and controls norm SBR-R03 | checks/same.ts | check |
shtuk check runs the checks; shtuk run shtukbase-ui-react <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.
Pages 4
They go into the project at these paths.
- /design/
- The Shtukbase React component library page
- /norms/rules/shtukbase-ui-react/
- The component library is intact SBR-R01
- A component has a states file SBR-R02
- The same components as the HTML library SBR-R03
Package files 146
They go into .shtukbase/packages/shtukbase-ui-react/; actions run from there.