Werkbank is a type-safe, performance-oriented UI component library for React applications. It provides a set of accessible, WAI-ARIA compliant components optimized for Parcel and Vanilla Extract.
Ensure the development environment meets the following requirements:
localhost) is required for certain browser APIs.Werkbank utilizes a specific stack to optimize for build size and type safety:
Use the create-parcel scaffolding tool to set up a new React application configured for Parcel.
npm create parcel react-client my-werkbank-app
cd my-werkbank-app
Install the required core packages and development tools.
npm install werkbank valibot
npm install --save-dev @vanilla-extract/parcel-transformer @vanilla-extract/css typescript
Global configuration is managed via package.json and .parcelrc.
Configure the Parcel resolver to respect package exports.
{
"name": "my-werkbank-app",
"@parcel/resolver-default": {
"packageExports": true
}
}
Configure the Vanilla Extract transformer to process TypeScript style definitions (.css.ts) before other transformations.
{
"extends": "@parcel/config-default",
"transformers": {
"*.css.ts": ["@vanilla-extract/parcel-transformer", "..."],
"*.css.js": ["@vanilla-extract/parcel-transformer", "..."]
}
}
Update the main application file to apply the theme and render a component.
Import the following:
defaultTheme: The pre-configured theme class from Werkbank.cx: A type-safe utility for concatenating class names.reset.css: The CSS reset for browser consistency.import React from 'react';
import { Button } from 'werkbank/component/button';
import { defaultTheme } from 'werkbank/style/theme';
import { cx } from 'werkbank/utils';
import 'werkbank/style/reset.css';
import * as styles from './index.css';
export const App = () => (
<div className={cx(defaultTheme, styles.container)}>
<h1>Werkbank Initialization</h1>
<p>System operational.</p>
<Button
type="button"
onClick={() => alert('Action triggered')}
>
Execute
</Button>
</div>
);
Werkbank supports deep imports (e.g., werkbank/component/button). This practice allows the bundler to include only the necessary code, minimizing the final bundle size.
Werkbank is licensed under MPL-2.0.