banhaten
v0.1.3
Published
Banhaten design system: an Arabic and English-first React design system with shadcn-style component installation.
Maintainers
Readme
Banhaten Design System
Banhaten is an Arabic and English-first React design system with source-installed components, generated design tokens, and first-class RTL behavior. It uses a shadcn-style distribution model without copying shadcn visuals: components are built around Banhaten tokens, Banhaten component aliases, and Banhaten Figma-derived interaction patterns.
Quick Start
Run the CLI from the root of a React app:
npx banhaten init
npx banhaten add button input selectWhen dependencies are added, the CLI prints the install command for your package manager.
npm install
pnpm install
yarn install
bun installWhat Init Adds
banhaten init writes:
banhaten.config.jsonwith schema-backed aliases.- The base
cnutility anduse-directionhook. - The generated Banhaten token stylesheet in your configured CSS file.
- Tailwind v4 and Vite alias setup when those files are detected.
- Required package dependencies.
banhaten add and banhaten update also refresh the generated token stylesheet, so installed projects receive token changes as the registry evolves.
CLI
npx banhaten init [--cwd <path>] [--force] [--dry-run]
npx banhaten add <component...> [--cwd <path>] [--force] [--dry-run]
npx banhaten diff [component...] [--cwd <path>] [--force]
npx banhaten update [component...] [--cwd <path>] [--force] [--dry-run]
npx banhaten list [--json]
npx banhaten search <query> [--json]
npx banhaten docs <component> [--json]
npx banhaten view <component> [--file <registry-source>] [--json]
npx banhaten versionGlobal flags:
--cwd <path>runs against another project directory.--dry-runpreviews writes.--forcerewrites generated files even when already current.--jsonprints machine-readable output where supported.--silentor-ssuppresses normal command output.--yesor-yis accepted for non-interactive scripts.--versionor-vprints the CLI version.
Generated File Ownership
Banhaten is a source registry. Installed component files are generated from the registry and are replaceable by banhaten add or banhaten update when registry content differs.
Use banhaten diff before updating if you edit generated component files locally:
npx banhaten diff
npx banhaten update buttonKeep product-specific composition outside generated files when possible. Use local wrapper components for app behavior and keep Banhaten files focused on tokens, layout, accessibility primitives, and direction behavior.
Tokens
Every component must style through Banhaten CSS variables, component aliases, or documented exception-ledger values. Raw colors, pixel values, opacity utilities, z-index utilities, durations, and shadow literals are blocked by the component token check.
Token modes:
- Color mode: light and dark.
- Brand theme:
blue,gray,brown,orange,green,purple,teal. - Radius mode:
default,rounded,sharp. - Direction: inherited LTR or RTL, with component-level
dirsupport where needed.
Example:
<html className="dark" data-theme="brown" data-radius="rounded" dir="rtl" lang="ar">Typography utilities are generated as .bh-text-* classes and map directly to token variables.
<h1 className="bh-text-heading-xl-bold">...</h1>
<p className="bh-text-body-md-regular">...</p>Registry Formats
Banhaten maintains two registry artifacts:
registry/index.jsonis the Banhaten source of truth used by the Banhaten CLI. It includes rich metadata for RTL behavior, parts, examples, files, and dependencies.registry.jsonis a generated shadcn-compatible export for tools that expect the public shadcn registry schema.
Regenerate the shadcn-compatible export after registry changes:
npm run registry:exportDocumentation
Primary docs live in the playground and render live registry-backed previews, install commands, source snippets, API tables, registry files, RTL behavior, and copyable code panels.
Markdown docs live in docs/design-system/components. They are checked for install, API, examples, token contract, RTL rules, and accessibility sections.
Useful commands:
npm run docs:check
npm run docs:normalize
npm run playground:devComponents
The registry includes core primitives such as Button, Input, Select, Field, Modal, Sheet, Sidebar, Menu, Tabs, Toast, Table, and Chart. It also includes Banhaten-specific and product-oriented components such as Attribute, Radio Card, Progress Slider, Social Button, Tag, Toolbar, Timeline, Banner, File Upload, Page Header, Command Bar, Slideout, Activity Feed, and Steps.
Expanded components are larger app compositions. They are installed through the same CLI but documented as a separate tier because their layout contracts are broader than primitive controls.
Development
npm run check
npm run tokens:check
npm run registry:check
npm run playground:testThe full check verifies CLI behavior, generated token CSS, token contract, raw token violations, registry mirrors, shadcn-compatible registry export, markdown docs, and playground coverage.
