Skip to content

ardelingga/react-ui-components

Repository files navigation

React UI Components

A comprehensive, modern React component library built with TypeScript, Tailwind CSS, and Storybook for professional web applications.

✨ Features

  • 🎨 25+ Production-Ready Components - Comprehensive component library
  • πŸ”§ Full TypeScript Support - Type-safe development experience
  • 🎭 Dark Mode Ready - Built-in dark mode support
  • πŸ“± Responsive Design - Mobile-first approach
  • β™Ώ Accessibility First - WCAG compliant components
  • πŸ“š Comprehensive Documentation - Detailed Storybook stories
  • πŸš€ Performance Optimized - Tree-shakeable and lightweight
  • πŸŽͺ Customizable - Easy to theme and extend

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/ardelingga/react-ui-components.git
cd react-ui-components

# Install dependencies
npm install

Development

# Start development server
npm run dev

# Start Storybook
npm run storybook

# Build for production
npm run build

πŸ“¦ Component Library

πŸŽ›οΈ Form Components

  • Button - Multiple variants with loading states
  • Input - Text inputs with validation styling
  • Label - Form labels with required indicators
  • Form - Complete form system with validation
  • Checkbox - Custom styled checkboxes
  • Select - Dropdown select component
  • Toggle - Switch toggle component
  • ToggleGroup - Grouped toggle selections

πŸ—‚οΈ Layout Components

  • Card - Flexible card container with sections
  • Modal - Dialog modals with animations
  • Sheet - Slide-out panels
  • Dialog - Confirmation and alert dialogs
  • Collapsible - Expandable content areas
  • Separator - Content dividers

🧭 Navigation Components

  • NavigationMenu - Multi-level navigation with dropdowns
  • Breadcrumb - Hierarchical navigation
  • DropdownMenu - Context menus and dropdowns

πŸ“Š Data Display Components

  • Table - Sortable tables with responsive design
  • Avatar - User avatars with fallbacks
  • Badge - Status indicators and labels
  • Alert - Notification and alert messages
  • Skeleton - Loading state placeholders

πŸ’¬ Feedback Components

  • Tooltip - Contextual information tooltips
  • Icon - Lucide React icon integration

πŸ“„ Complete Pages

  • Home Page - Landing page with hero section
  • Login Page - Authentication with social login
  • Register Page - User registration with validation

πŸ’‘ Usage Examples

Basic Button Usage

import { Button } from './components/Button/Button';

// Primary button
<Button variant="primary" size="md">
  Save Changes
</Button>

// Loading state
<Button variant="primary" loading>
  Processing...
</Button>

// With icon
<Button variant="outline">
  <Icon iconNode={Download} className="mr-2 h-4 w-4" />
  Download
</Button>

Card Component

import {
  Card,
  CardHeader,
  CardContent,
  CardFooter,
} from "./components/Card/Card";

<Card className="w-full max-w-md">
  <CardHeader>
    <h3 className="text-lg font-semibold">Product Card</h3>
  </CardHeader>
  <CardContent>
    <p>Detailed product description goes here.</p>
  </CardContent>
  <CardFooter>
    <Button className="w-full">Add to Cart</Button>
  </CardFooter>
</Card>;

Form Components

import { Form, FormField, FormLabel, FormInput } from "./components/Form/Form";

<Form onSubmit={handleSubmit}>
  <FormField>
    <FormLabel htmlFor="email" required>
      Email
    </FormLabel>
    <FormInput
      id="email"
      type="email"
      placeholder="Enter your email"
      required
    />
  </FormField>
  <Button type="submit">Submit</Button>
</Form>;

Data Table

import {
  Table,
  TableHeader,
  TableBody,
  TableRow,
  TableHead,
  TableCell,
} from "./components/Table/Table";

<Table>
  <TableHeader>
    <TableRow>
      <TableHead sortable onSort={() => handleSort("name")}>
        Name
      </TableHead>
      <TableHead sortable onSort={() => handleSort("email")}>
        Email
      </TableHead>
      <TableHead>Status</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    {users.map((user) => (
      <TableRow key={user.id}>
        <TableCell>{user.name}</TableCell>
        <TableCell>{user.email}</TableCell>
        <TableCell>
          <Badge variant={user.active ? "success" : "secondary"}>
            {user.active ? "Active" : "Inactive"}
          </Badge>
        </TableCell>
      </TableRow>
    ))}
  </TableBody>
</Table>;

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Alert/
β”‚   β”‚   β”œβ”€β”€ Alert.tsx
β”‚   β”‚   └── Alert.stories.tsx
β”‚   β”œβ”€β”€ Button/
β”‚   β”‚   β”œβ”€β”€ Button.tsx
β”‚   β”‚   └── Button.stories.tsx
β”‚   β”œβ”€β”€ Card/
β”‚   β”‚   β”œβ”€β”€ Card.tsx
β”‚   β”‚   └── Card.stories.tsx
β”‚   └── ... (other components)
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ Home/
β”‚   β”œβ”€β”€ LoginPage/
β”‚   └── RegisterPage/
β”œβ”€β”€ lib/
β”‚   └── utils.ts
β”œβ”€β”€ App.tsx
└── main.tsx

πŸ§ͺ Testing & Documentation

Storybook Stories

Every component includes comprehensive Storybook stories:

  • Default states
  • All variants and sizes
  • Interactive examples
  • Responsive previews
  • Accessibility testing
  • Dark mode examples
# Run Storybook
npm run storybook

πŸš€ Deployment

Build Commands

# Production build
npm run build

# Preview build locally
npm run preview

# Build Storybook
npm run build-storybook

πŸ› οΈ Development Scripts

# Development
npm run dev              # Start dev server
npm run storybook        # Start Storybook

# Building
npm run build            # Build for production
npm run build-storybook  # Build Storybook

# Code Quality
npm run lint             # Run ESLint
npm run type-check       # TypeScript type checking

πŸ“± Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Include Storybook stories for new components
  • Maintain responsive design principles
  • Ensure accessibility compliance
  • Write meaningful commit messages

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Ardelingga Pramesta Kusuma

πŸ™ Acknowledgments


⭐ Star this repository if it helped you! ⭐

Made with ❀️ and β˜• by Ardelingga

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages