API Reference
Relevant source files This document provides a comprehensive reference for all exported APIs from the@ui8kit/core library. It covers component exports, variant props, TypeScript interfaces, and naming conventions used throughout the codebase.
For architectural context and component relationships, see Architecture. For detailed API documentation of individual components, see sub-pages: Core Components, UI Components, and Layout Components. For usage patterns and examples, see Development Guide.
Export Structure
The library follows a flat export structure from src/index.ts All components, variants, hooks, and utilities are re-exported from this single entry point for simplified imports.Component Export Catalog
The following table documents all component exports with their source locations and TypeScript interfaces:
Sources: src/index.ts README.md362-386 src/registry.json2-244
Variant System API
The variant system provides 12 composable prop categories that apply across all components through the CVA (class-variance-authority) engine. Each variant category maps to specific TypeScript types and Tailwind CSS utility classes.Variant Prop Types
Variant Prop Reference Table
Sources: src/core/variants/ README.md174-217 .devin/wiki.json19-22
Prop Forwarding Pattern
Components in the library implement a consistent prop forwarding pattern where composite components extend base primitives with additional variant props. This creates a type-safe inheritance chain.Prop Forwarding Examples
The following examples demonstrate how variant props are forwarded from composite components to their base primitives: Button extends Box:TypeScript Type System
The library provides comprehensive TypeScript support with precise type definitions for all components, variants, and utilities.Core Type Hierarchy
Common Type Patterns
Sources: src/core/ui/ src/components/ui/ .devin/wiki.json11-14
Common Component Props
All components in the library share a consistent set of base props inherited from React’s HTML attributes and the variant system.Standard React Props
Custom Component Props
Sources: src/core/ui/Block.tsx src/components/ui/Text.tsx src/components/ui/Title.tsx .devin/wiki.json11-14
Theme System API
The theme system provides dark mode support, accessibility preferences, and theme persistence through React Context.Theme Provider
Utility Hooks API
The library exports responsive design utilities for viewport detection and media queries.
Usage Example:
Component-Specific Variants
Some components define additional variants beyond the core variant system for specialized styling.Button Variants
Card Variants
Data Attributes
All components render withdata-class attributes for consistent DOM targeting and styling.
Usage Example:
Detailed API Documentation
For complete API documentation of individual components with all props, methods, and usage examples, see:- Core Components - Primitives:
Block,Box,Grid,Flex,Stack - UI Components - Composite components:
Button,Card,Text,Title,Badge, etc. - Layout Components - Layout templates:
DashLayout,LayoutBlock,SplitBlock