The Shtukbase React component library
React components of the Shtukbase design, the same ids and markup as the HTML library: where the code is placed, what the project needs, how a control becomes a prop.
The same components as the HTML library, in React: the same ids, levels, states and controls, the same markup (data-slot, classes, data-<control> attributes). The six primitives that shadcn has (button, badge, input, select, switch, slider) are the shadcn components, style new-york-v4, with our class and attributes added; the rest are written in the same manner. The look is the CSS of the HTML library, written once; this library imports it and adds behaviour.
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 (nowsrc/sb-ui). If you change it, runshtuk run shtukbase-ui-react place: the library will be placed in the new folder. - The CSS file is the
css:field (by default theui.cssof the HTML library, which joins the CSS of every component). The path to it is written in the@importofstyles/index.css. placealso adds the folder tosources:in the header of the Components collection, so thatdesign-components synclists the React component next to its HTML one (the one-line formsources: [a, b]; any other form is left alone andplacesays so).- Next to the code lies
.shtukbase-ui-react.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;
placenames them. To replace those too:shtuk run shtukbase-ui-react place --force.
What is in the folder:
| Folder | What |
|---|---|
primitives/ | button, badge, chip, icon-plate, kicker, input, select, switch, slider, swatches, avatar, checkbox, label, progress, radio-group, separator, skeleton, textarea, tooltip, status-dot |
composites/ | card, package-card, field, accordion, alert, breadcrumb, command, dialog, dropdown-menu, popover, table, tabs; ours record-card, property-row, details-card, empty-state, tree-item, toolbar, search-field, settings-group |
blocks/ | area, package-grid, settings-bar |
shell/ | Sidebar, panels, sections, collapsible, scroll area, sheet, and page forms used by a lens layout |
lib/define.ts | the contract of a states file: defineComponent, defineStates |
lib/controls.ts | controls as attributes and custom properties: dataProps, rangeStyle |
lib/utils.ts | cn, class merging |
lib/icons.tsx | the small line icons of the templates, and two prop helpers |
styles/index.css | imports the ui.css of the HTML library |
Every component has a header in its first comment and a <id>.states.tsx with meta and states; the state names are those of the header, and each is the props that draw the matching <template> of the HTML library.
Controls are props
The header of a component lists its controls; the same list is in the HTML library. In React a control is a prop named like the control in camelCase:
<PackageCard preset="cover" size="l" glow="halo" glowStrength={60} title="Basic" />
A select, segment, swatch or text control becomes data-<control>="<value>" on the root, a bool the bare attribute, a range the inline custom property --<id>-<control>: exactly what the HTML library writes, so one CSS serves both.
What the project needs
The package does not install dependencies. The project installs them itself:
reactandreact-dom^19;radix-ui(the shadcn primitives:Slot,Switch,Select,Slider),class-variance-authority^0.7,cn^0.5,lucide-react;tailwindcss^4 andtw-animate-css(the shadcn primitives keep their Tailwind classes; the theme comes from theshadcnpackage and the style);- TypeScript with
jsx: react-jsx.
Connecting the look is one line in the application's main CSS, after Tailwind: @import "./sb-ui/styles/index.css"; (the path from your file to the target folder). The CSS of the HTML library is plain CSS outside Tailwind's layers, so where a shadcn utility and a component rule set the same property, the component rule wins.
Source
shadcn/ui components: MIT, © 2023 shadcn, style new-york-v4, read on 28.11.2026 (the slider, which the shadcn package does not carry, on 29.11.2026).
/design/shtukbase-ui-react.md.Source text