Skip to main content

Overview

Relevant source files This document introduces @ui8kit/core, a minimalist React UI component library built on utility-first Tailwind CSS and semantic HTML5. It covers the design philosophy, architectural layers, component inventory, variant system, and integration methods. For installation instructions and setup, see Getting Started.
For detailed architectural descriptions, see Architecture.
For complete API documentation, see API Reference.
Sources: .devin/wiki.json24-33 README.md1-10

Purpose and Scope

@ui8kit/core is a production-ready React component library designed to enable rapid interface development with minimal code. The library provides 23 total components organized in three architectural layers, styled through 12 composable CVA-based variants that eliminate the need for manual className management in ~80% of use cases. Target Audience: React developers building applications with Tailwind CSS who prioritize:
  • Minimal bundle size and code footprint
  • Type-safe component APIs with TypeScript
  • Semantic HTML5 for accessibility and SEO
  • Flexible composition patterns without rigid design constraints
What This Library Provides:
  • 5 core primitive components (Layer 1) for foundational layouts
  • 15 UI composite components (Layer 2) for common interface patterns
  • 3 layout template components (Layer 3) for application structures
  • 12 reusable variant categories covering spacing, colors, layout, typography, and effects
  • Multiple integration methods: NPM package, per-component installation, git submodule, direct source
What This Library Does Not Provide:
  • Opinionated design system with fixed visual style
  • Form validation or state management
  • Animation framework
  • Icon library (depends on lucide-react for icons in specific components)
Sources: package.json1-20 README.md3-19 .devin/wiki.json2-10

Design Philosophy

The library is built on the principle of minimal code with maximum flexibility. Complex interfaces emerge from composing a small set of primitives rather than assembling dozens of specialized components.

Core Principles

Minimalism in Practice

The library achieves interface complexity through composition rather than component proliferation:
Both achieve the same result, but the primitive approach:
  • Eliminates 4 specialized components from the bundle
  • Provides full styling control through variants
  • Maintains semantic HTML with component="form" and component="input"
  • Requires no additional component learning curve
Sources: README.md388-403 .devin/wiki.json7-10 src/components/GUIDE_CREATE_FORM.md1-100

Component Architecture

Architecture: Three-Layer Component Hierarchy The library implements a strict three-layer hierarchy aligned with atomic design principles:

Layer 1: Core Primitives (src/core/ui/)

Five foundational components that directly apply the variant system: These primitives provide the foundation for all higher-layer components. They render semantic HTML5 elements and accept variant props directly.

Layer 2: UI Components (src/components/ui/)

Fifteen composite components that extend primitives through prop forwarding: These components inherit all variant props from their base primitives while adding component-specific props.

Layer 3: Layout Templates (src/layouts/)

Three template components that orchestrate Layer 2 components into application structures: Sources: README.md62-168 src/core/ui/Block.tsx1-50 src/core/ui/Box.tsx1-40 src/components/ui/button.tsx1-100 src/components/ui/card.tsx1-150 src/layouts/DashLayout.tsx1-100

Variant System Overview

Variant System: CVA-Based Styling Pipeline The variant system centralizes all styling logic through 12 composable variant categories, eliminating the need for manual className management in most scenarios.

Variant Categories

Variant Application Flow

  1. Developer writes variant props in JSX: <Card p="lg" rounded="xl" shadow="md" bg="card" />
  2. CVA engine resolves props to Tailwind classes via cva() function from class-variance-authority
  3. Generated classes output: p-8 rounded-xl shadow-md bg-card
  4. Whitelist validation ensures Tailwind purge doesn’t remove necessary classes (618 classes in core-classes.json)
  5. DOM renders with final class string applied

Build-Time Class Extraction

The scripts/cva-extractor.ts script scans all variant files and generates src/lib/core-classes.json:
This whitelist serves two purposes:
  • Tailwind safelist - prevents CSS purge from removing variant classes
  • tw-merge safety - ensures class merging works correctly
Sources: README.md170-217 src/core/variants/spacing-variants.ts1-100 src/core/variants/color-variants.ts1-80 scripts/cva-extractor.ts1-260 src/lib/core-classes.json1-619

Technology Stack

Core Dependencies

Build Tools

Distribution Format

The library distributes as ES2022 modules with TypeScript declarations: Export Configuration in package.json33-37:
Sources: package.json48-69 package.json30-37 README.md422-440

Integration Methods

Integration Methods: Five Approaches The library supports five distinct integration methods to accommodate different development workflows:

Method 1: Full Library Installation (NPM)

Use Case: Standard application development with all components available
Imports:
Bundle Size: Full library (~15 UI components + 3 layouts + 5 primitives) Advantages:
  • Single dependency declaration
  • All components immediately available
  • Automatic updates via npm update
Sources: README.md21-34 package.json2-3

Method 2: Per-Component Installation (buildy-ui CLI)

Use Case: Bundle optimization, progressive adoption, microservices
Result: Copies component files to components/ui/ directory
Imports:
Advantages:
  • Minimal bundle size (only installed components)
  • No dependency on full library
  • Full source code control
Registry Metadata in src/registry.json1-244:
Sources: README.md252-276 src/registry.json1-244

Method 3: Git Submodule (Monorepo)

Use Case: Monorepo architectures, shared component libraries across projects
TypeScript Configuration:
Advantages:
  • Direct source access
  • Version pinning via git commits
  • Shared across monorepo packages
  • Local modifications possible
Sources: SUBMODULE_GUIDE.md1-300 (referenced in diagrams)

Method 4: Direct Source Integration

Use Case: Custom builds, heavily modified components, embedded systems Process:
  1. Copy src/ directory to project
  2. Adjust import paths
  3. Customize components as needed
  4. Build with project’s TypeScript compiler
Advantages:
  • Complete control over source code
  • No external dependencies
  • Custom compilation targets
  • Remove unused components

Method 5: Programmatic Registry Access

Use Case: Build tooling, component documentation generators, automated testing
Registry Structure:
Advantages:
  • Automate component discovery
  • Generate documentation
  • Build custom CLI tools
  • Validate component metadata
Sources: README.md267-276 src/registry.json1-10

Component Inventory

Complete Component List

Component Distribution by Type

Variant Coverage Statistics

Sources: README.md361-387 README.md388-403

Key Features Summary

Type Safety and Developer Experience

Performance and Bundle Size

Design Flexibility

Sources: README.md9-19 package.json30 src/themes/providers/ThemeProvider.tsx1-109

Getting Started

To begin using @ui8kit/core, proceed to Getting Started for installation instructions and basic configuration examples. For detailed architectural documentation, see Architecture.
For component API reference, see API Reference.
For development patterns and best practices, see Development Guide.
Sources: .devin/wiki.json35-43 README.md21-60