Introduction

Hareru UI — A semantic design system built for agents

Hareru UI is a semantic design system built for agents. It provides 40+ accessible React components, a registry-first architecture, and first-class AI agent integration via MCP server, CLI, and machine-readable contracts.

Key Features

  • Semantic CSS — BEM naming (hui-*) and CSS custom properties (--hui-*). No Tailwind dependency.
  • Layered architecture — Tokens, styles, and component behavior live in independent packages. Each layer is consumable on its own by both humans and AI agents.
  • DTCG tokens — 150+ tokens in W3C Design Token Community Group format with JSON Schema validation.
  • Zero-runtime theming — Light and dark themes via data-theme attribute. Pure CSS, no JS runtime cost.
  • OKLCH colors — Perceptually uniform color space with automatic dark theme generation.
  • Accessible components — 40+ components built on Base UI primitives. WAI-ARIA compliant.
  • 4 CSS modes — Standalone, portable, Tailwind v4 coexistence (Cascade Layers), and per-component.
  • MCP server@hareru/mcp exposes design rules directly where AI agents operate via Model Context Protocol.
  • CLInpx @hareru/cli add Button --write to generate CSS imports with auto-detected entry file.
  • AG-UI chat components — ChatContainer, StreamingText, ToolCallCard, and useAGUIState hook for agent UIs.

Architecture

DecisionChoiceReason
CSS variable prefix--hui-Short, unique abbreviation
BEM naminghui-button--variantSemantic + collision avoidance
Theme switchingdata-theme attributeClear CSS variable scoping
Color formatOKLCHPerceptually uniform + gamut mapping
tailwind-mergeNot usedBEM classes do not conflict
Cascade Layers@layer hui for Tailwind v4Coexistence without specificity wars
Component patternforwardRefGuarantees external ref access
DistributionRegistry-firstMachine-readable contracts drive CLI, MCP, and docs

Packages

PackageDescription
@hareru/tokensDesign tokens + CSS variable generation (DTCG format)
@hareru/ui40+ React components with BEM CSS
@hareru/registryShared registry types, loaders, and CSS mode recommendation
@hareru/cliCLI for component management — list, info, add
@hareru/mcpMCP server for AI agent integration

On this page