Skip to content
QuaUI
On this page

TSX and QSS authoring

Build the TypeScript package from source, configure JSX and mount an interactive DOM button.

Prepare the dependency

Use Node.js 22.12 or later and pnpm 12.3.4. Build the installable package from source.

Shell
git clone https://github.com/QuaDevTeam/QuaUI.gitcd QuaUIpnpm install --frozen-lockfilepnpm buildpnpm pack --pack-destination ../packages

In the application directory, install the resulting file with pnpm add /absolute/path/to/packages/quajs-quaui-0.1.0.tgz. Merge these compiler options into the application's tsconfig.json and use a .tsx extension.

JSON
{ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "@quajs/quaui" }}

Mount the button

TSX
import { Button, makeIntent } from '@quajs/quaui'import { analyzeQssSource, compileQuiTsxProjection } from '@quajs/quaui/runtime'import { createDomSurface } from '@quajs/quaui/web'export function mountButton(stage: HTMLElement, advance: () => void) { const qss = analyzeQssSource( 'Button { width: 152px; height: 48px; border-radius: 12px; background-color: #a34161; color: #ffffff; }' ) const tree = <Button id="next" onClick={makeIntent('ui/intent', 'advance')}>Continue →</Button> const dom = createDomSurface({ container: stage, onIntent(intent) { if (intent.action === 'advance') advance() } }) dom.update(compileQuiTsxProjection(tree, { qss }).root) return dom.dispose}

Pass a stage with position: relative and at least 152 × 48 CSS pixels. Supply the application's own advance function. Recompile the tree and call dom.update when state changes. Call the returned disposer when unmounting the page.

Styles and tooling

@quajs/quaui/runtime provides platform-neutral QSS parsing and projection. Inspect qss.diagnostics before compiling to find unsupported declarations. @quajs/quaui/compiler provides build-time checks, formatting and optional Sass support. See layout and paint and media and effects.