UI Components Library
A modern, accessible React component library built with TypeScript, Tailwind CSS, and best practices for production use.
Features
- ๐จ Modern Design System - Consistent colors, typography, and spacing
- โฟ Accessibility First - WCAG compliant with ARIA attributes and keyboard navigation
- ๐ฑ Responsive Design - Mobile-first approach with proper breakpoints
- ๐ญ Smooth Animations - Framer Motion powered micro-interactions
- ๐ Storybook Documentation - Interactive component documentation
- ๐ง TypeScript Support - Full type safety and IntelliSense
- ๐ฏ Tree Shakeable - Import only what you need
- ๐งช Battle Tested - Used in production TaskFlow application
Quick Start
Installation
npm install @codeharborhub/ui-components
Setup
Import the CSS file in your main application file:
import '@codeharborhub/ui-components/styles.css';
Basic Usage
import { Button, Input, Card, Modal } from '@codeharborhub/ui-components';
function App() {
return (
<Card>
<h1>Welcome!</h1>
<Input label="Email" type="email" placeholder="Enter your email" />
<Button variant="primary">Get Started</Button>
</Card>
);
}
Components
Button
Versatile button component with multiple variants and states.
<Button variant="primary" size="md" leftIcon={<Plus />}>
Add Item
</Button>
Props:
variant: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger'
size: 'sm' | 'md' | 'lg'
isLoading: boolean
leftIcon, rightIcon: ReactNode
Input
Form input with validation, icons, and helper text.
<Input
label="Password"
type="password"
error="Password is required"
leftIcon={<Lock />}
required
/>
Props:
label: string
error: string
helperText: string
leftIcon, rightIcon: ReactNode
Card
Flexible container with header, content, and footer sections.
<Card variant="elevated" hover>
<CardHeader>
<CardTitle>Title</CardTitle>
<CardDescription>Description</CardDescription>
</CardHeader>
<CardContent>Content here</CardContent>
<CardFooter>
<Button>Action</Button>
</CardFooter>
</Card>
Modal
Accessible modal dialog with animations.
<Modal
open={isOpen}
onOpenChange={setIsOpen}
title="Confirm Action"
size="md"
>
<p>Are you sure?</p>
<ModalFooter>
<Button variant="outline">Cancel</Button>
<Button variant="danger">Delete</Button>
</ModalFooter>
</Modal>
Badge
Status and category indicators.
<Badge variant="success">Completed</Badge>
<Badge variant="warning">Pending</Badge>
<Badge variant="danger">Failed</Badge>
Demo Application
The TaskFlow application demonstrates real-world usage of all components:
- Authentication System - Login, signup, and password reset
- Task Management - Create, edit, delete, and organize tasks
- Real-time Updates - Supabase integration for data persistence
- Responsive Design - Works on mobile, tablet, and desktop
Running the Demo
Visit http://localhost:5173 to see the TaskFlow demo application.
Storybook Documentation
View interactive component documentation:
Visit http://localhost:6006 to explore all components with live examples.
Design System
Colors
- Primary: Blue (#3B82F6)
- Secondary: Emerald (#10B981)
- Accent: Violet (#8B5CF6)
- Success: Green (#10B981)
- Warning: Yellow (#F59E0B)
- Danger: Red (#EF4444)
Spacing
8px base unit system (8, 16, 24, 32, 40, 48px)
Typography
- Headings: 120% line height
- Body: 150% line height
- Weights: Regular (400), Medium (500), Semibold (600)
Accessibility Features
- โ
ARIA Attributes - Proper labeling and roles
- โ
Keyboard Navigation - Full keyboard support
- โ
Focus Management - Visible focus indicators
- โ
Color Contrast - WCAG AA compliant
- โ
Screen Reader Support - Semantic markup
- โ
Error Handling - Clear error messages
Browser Support
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
Development Setup
# Install dependencies
npm install
# Start development server
npm run dev
# Run Storybook
npm run storybook
# Build library
npm run build:lib
# Lint code
npm run lint
License
MIT ยฉ CodeHarborHub
Support