Skip to main content

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.
Sources: src/index.ts README.md362-386 .devin/wiki.json136-139

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

Sources: src/core/variants/ README.md170-217 .devin/wiki.json19-22

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.
Sources: src/components/ui/Button.tsx src/core/ui/Box.tsx .devin/wiki.json11-14 README.md14-17

Prop Forwarding Examples

The following examples demonstrate how variant props are forwarded from composite components to their base primitives: Button extends Box:
Card extends Block:
Text extends Box:
Sources: src/components/ui/Button.tsx src/components/ui/Card.tsx src/components/ui/Text.tsx README.md38-60

TypeScript Type System

The library provides comprehensive TypeScript support with precise type definitions for all components, variants, and utilities.

Core Type Hierarchy

Sources: src/core/ui/Box.tsx src/core/ui/Block.tsx src/components/ui/Button.tsx src/components/ui/Card.tsx src/layouts/

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

Sources: src/themes/providers/ThemeProvider.tsx1-109 src/themes/modern-ui.ts README.md219-249

Utility Hooks API

The library exports responsive design utilities for viewport detection and media queries. Usage Example:
Sources: src/lib/hooks/ README.md341-359

Component-Specific Variants

Some components define additional variants beyond the core variant system for specialized styling.

Button Variants

Sources: src/components/ui/Button.tsx README.md284-303

Card Variants

Sources: src/components/ui/Card.tsx README.md125-144

Data Attributes

All components render with data-class attributes for consistent DOM targeting and styling. Usage Example:
Sources: src/core/ui/ src/components/ui/ .devin/wiki.json11-14

Detailed API Documentation

For complete API documentation of individual components with all props, methods, and usage examples, see: Sources: .devin/wiki.json135-168 src/index.ts README.md1-453