How doosemavis/bit-design-system works
bit is a React design system with a companion component gallery. The user-facing gallery workflow is route to a component manifest, adjust controls and presets, inspect a live preview, and copy generated JSX; control state is URL-backed. The library supplies themed components, color-mode behavior, and shared class/axis utilities. Gallery routing and page composition are excerpted; library component exports and utility usage are supported by the SOURCE INDEX. Theme CSS and several gallery internals are unsampled, so their implementation links are omitted.
Main entry points: ComponentPage.tsx Component page · index.ts React package API · router.tsx Page routing · system Class and axis system
Components 20
Component gallery
- Gallery app
apps/gallery/src/main.tsx - Page routing
apps/gallery/src/router.tsx - Gallery shell
apps/gallery/src/shell - Home and tokens
apps/gallery/src/pages - Component page
apps/gallery/src/pages/ComponentPage.tsx - Component manifests
apps/gallery/src/manifests - URL control state
apps/gallery/src/engine/useControlState.ts - Preview and controls
apps/gallery/src/engine - JSX generator
apps/gallery/src/code/toJsx.ts
React components
- React package API
packages/react/src/index.ts - Actions and layout
packages/react/src/components - Form controls
packages/react/src/components - Content and choice
packages/react/src/components - Brand components
packages/react/src/logo
Shared system
- Color mode
packages/react/src/mode/colorMode.ts - Class and axis system
packages/react/src/system - Field context
packages/react/src/components/Field/FieldContext.ts
Tokens and themes
- Design tokens
packages/core/src/tokens.ts - Theme styles
Other components
- Developer
Connections 23
- Developer → Gallery app: opens
README.md - Gallery app → Page routing: renders
apps/gallery/src/main.tsx - Page routing → Gallery shell: wraps pages
apps/gallery/src/router.tsx - Page routing → Home and tokens: routes to
apps/gallery/src/router.tsx - Page routing → Component page: routes to
apps/gallery/src/router.tsx - Component page → Component manifests: looks up
apps/gallery/src/pages/ComponentPage.tsx - Component page → URL control state: reads state
apps/gallery/src/pages/ComponentPage.tsx - URL control state → Component manifests: parses state
apps/gallery/src/engine/useControlState.ts - Component page → Preview and controls: renders
apps/gallery/src/pages/ComponentPage.tsx - Component page → JSX generator: generates example
apps/gallery/src/pages/ComponentPage.tsx - JSX generator → Component manifests: reads definitions
apps/gallery/src/code/toJsx.ts - Component page → React package API: uses components
apps/gallery/src/pages/ComponentPage.tsx - React package API → Actions and layout: exports
packages/react/src/index.ts - React package API → Form controls: exports
packages/react/src/index.ts - React package API → Content and choice: exports
packages/react/src/index.ts - React package API → Brand components: exports
packages/react/src/index.ts - Actions and layout → Class and axis system: builds classes
packages/react/src/components/Button/Button.tsx - Form controls → Class and axis system: builds classes
packages/react/src/components/SegmentedControl/SegmentedControl.tsx - Content and choice → Class and axis system: builds classes
packages/react/src/components/Table/Table.tsx - Form controls → Field context: shares field state
packages/react/src/components/Select/Select.tsx - Color mode → Theme styles: sets mode attribute
README.md - Class and axis system → Design tokens: uses axes
packages/react/src/system/axes.ts - Gallery app → Theme styles: loads styles
apps/gallery/src/main.tsx