@qball-inc/react
v1.0.1
Published
QBall Design System React components — token-driven, framework-agnostic at the CSS layer. Dual ESM/CJS build with TypeScript declarations.
Maintainers
Readme
Every component is a Strategy-2 className wrapper: it applies the shipped
@qball-inc/tokens classes and emits no CSS of its own. So the React package is
the behavior and accessibility layer; the visual layer arrives entirely from the
token CSS you import.
Install
pnpm add @qball-inc/react @qball-inc/tokens react react-domThe components are built on Radix UI primitives, declared as peer dependencies — pnpm/npm install them alongside automatically (with a strict setup, add any your bundler reports as missing). Two peers are optional, needed only for the one component that uses them:
| Optional peer | Needed for |
| ----------------------- | ----------------------------------- |
| @tanstack/react-table | DataTable (its headless core) |
| d3 | Candlestick (the D3 chart island) |
The icon system has no runtime icon-pack dependency — the marks are compiled to our own inline SVGs at build time.
Wire the token CSS (required)
Because the components emit no CSS, you must import the @qball-inc/tokens layer
or everything renders unstyled. Order matters.
/* app.css */
@import "@qball-inc/tokens/colors-and-type.css"; /* tokens + .btn — REQUIRED, first */
@import "@qball-inc/tokens/components.css"; /* component layer — REQUIRED, second */// main.tsx
import "./app.css";
import { Button, Stat } from "@qball-inc/react";
export function App() {
return (
<main>
<Button variant="primary">Add to watchlist</Button>
<Stat label="AAPL" value="184.30" unit="USD" direction="up" delta="+8.4%" />
</main>
);
}Switch themes with data-theme="light|dark" on <html>. Full wiring guide
(Tailwind @theme, the --font-display override, @source scanning):
docs/consumer-setup.md.
What's included
| Family | Components |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Primitives | Button · Input · Field · Select · Switch · Segmented · SecretInput · Search |
| Overlays | Modal · AlertModal · Toaster/toast · Callout · Skeleton · Spinner · EmptyStateFig/ErrorStateFig |
| Data display | Stat · Meter · Badge · Card · Divider · Tabs · Sparkline · Tooltip · Avatar/AvatarGroup · DataTable · Candlestick |
| App chrome | AppBar · UserMenu · ThemeToggle · Scrim · CommandDock · NotificationCenter |
| AI / domain | Terminal · Composer · useStreaming · GroundingFlag · MarkdownRenderer · ToolUseIndicator · DigestCard |
| Backgrounds | GridBg · AsciiBg · GlyphsBg (+ the useCanvas2D driver) — SSR-safe animated <canvas> |
| Icons | Icon (dynamic registry) + per-icon named exports (tree-shakeable) + a nominative brand-mark track |
| Media | MediaSlot — a pure-React, SSR/static-safe display container (image / gif / video / embed-facade) |
All components are token-driven (no hardcoded color, no box-shadow), pair finance
color with a non-color cue, and honor prefers-reduced-motion. Browse every one in
the live gallery.
Part of the QBall Design System
- Tokens:
@qball-inc/tokens— the locked token layer this package paints with. - Gallery: live component contact-sheet (light + dark).
- Source + docs: QBall-Inc/qball-design-system.
License
Apache-2.0 © QBall Inc. The icon system's brand track ships a small set of third-party brand marks for nominative identification only (e.g. a "Sign in with Google" affordance) — see MARKS.md. These remain the trademarks of their respective owners.
