@hua-labs/hua
v1.0.3
Published
HUA - Ship UX faster: UI + motion + i18n, pre-wired. A framework for React product teams.
Downloads
293
Maintainers
Readme
@hua-labs/hua
Batteries-included framework for React product teams. Unifies UI components, animation hooks, internationalization, state management, and utilities into a single dependency with automatic provider setup for Next.js.
Features
- Pre-wired — UI, motion, i18n, state configured and ready to use
- Framework layer — Next.js-optimized with defineConfig and automatic providers
- Accessibility — WCAG 2.1 compliant utilities (focus management, skip-to-content)
- Loading UX — Built-in delayed loading, suspense wrappers
- Error handling — ErrorBoundary built into HuaPage
- White-labeling — SSR-compatible CSS variable injection via branding config
- GEO support — Generative Engine Optimization for AI search engines
Installation
pnpm add @hua-labs/huaPeer dependencies: next >=13.0.0, react >=19.0.0, react-dom >=19.0.0, server-only ^0.0.1
Quick Start
// hua.config.ts
import { defineConfig } from '@hua-labs/hua/framework/config';
export default defineConfig({
preset: 'product',
i18n: {
defaultLanguage: 'ko',
supportedLanguages: ['ko', 'en'],
namespaces: ['common'],
translationLoader: 'api',
translationApiPath: '/api/translations',
},
});
// app/layout.tsx
import { HuaProvider } from '@hua-labs/hua/framework';
export default function RootLayout({ children }) {
return (
<html lang="ko">
<body>
<HuaProvider>{children}</HuaProvider>
</body>
</html>
);
}
API
| Export | Type | Description |
|--------|------|-------------|
| Button | component | Branded button — auto-applies branding colors when configured |
| Card | component | Branded card — auto-applies branding colors when configured |
| defineConfig | function | Define hua configuration with presets (product, landing, docs) |
| HuaProvider | component | Root layout provider — auto-wires theme, i18n, motion, branding |
| HuaPage | component | Page wrapper with ErrorBoundary and loading states |
Documentation
Architecture
@hua-labs/hua is a meta-framework that re-exports from sub-packages and adds a framework layer on top.
@hua-labs/hua
├── /framework ← HuaProvider, defineConfig, HuaPage (framework-only)
├── /ui ← re-export @hua-labs/ui (100+ components)
├── /motion ← re-export @hua-labs/motion-core
├── /i18n ← re-export @hua-labs/i18n-core
├── /state ← re-export @hua-labs/state
├── /formatters ← re-export @hua-labs/i18n-formatters
├── /hooks ← re-export @hua-labs/hooks
├── /utils ← re-export @hua-labs/utils
└── /loaders ← re-export @hua-labs/i18n-loadersThe main entry (@hua-labs/hua) exports everything flat for convenience. Use subpath imports for tree-shaking.
Configuration Presets
| Preset | Use Case | Includes |
|--------|----------|----------|
| product | Full-featured product app | UI + i18n + state + motion + branding |
| landing | Marketing/landing pages | UI + motion + GEO |
| docs | Documentation sites | UI + i18n + code blocks |
// Minimal config — preset handles defaults
export default defineConfig({ preset: 'product' });Related Packages
License
MIT — HUA Labs
