"use client" import { useState, useMemo } from "react" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Input } from "@/components/ui/input" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Switch } from "@/components/ui/switch" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Progress } from "@/components/ui/progress" import { Slider } from "@/components/ui/slider" import { Search, ExternalLink, Check } from "lucide-react" import Link from "next/link" // All components data with preview components const allComponents = [ { id: "accordion", name: "Accordion", description: "Collapsible content sections", category: "Layout", preview: (
Section 1
Content here...
Section 2
), }, { id: "alerts", name: "Alert", description: "Important messages and notifications", category: "Feedback", preview: (
Info message
Success!
), }, { id: "alert-dialog", name: "Alert Dialog", description: "Modal dialogs for critical actions", category: "Overlay", preview: (
Confirm Action
Are you sure?
Cancel
Confirm
), }, { id: "avatars", name: "Avatar", description: "User profile pictures and placeholders", category: "Display", preview: (
SM JD +3
), }, { id: "badges", name: "Badge", description: "Small status indicators and labels", category: "Display", preview: (
New Pro Beta Error
), }, { id: "breadcrumbs", name: "Breadcrumb", description: "Navigation hierarchy indicators", category: "Navigation", preview: (
Home / Products / Item
), }, { id: "buttons", name: "Button", description: "Interactive elements for actions", category: "Input", preview: (
), }, { id: "calendar", name: "Calendar", description: "Date selection and display", category: "Input", preview: (
December 2024
{["S", "M", "T", "W", "T", "F", "S"].map((day, i) => (
{day}
))} {Array.from({ length: 14 }, (_, i) => (
{i < 7 ? "" : i - 6}
))}
15
), }, { id: "cards", name: "Card", description: "Flexible content containers", category: "Layout", preview: ( Card Title Card description here
Content goes here...
), }, { id: "checkbox", name: "Checkbox", description: "Binary choice input controls", category: "Input", preview: (
Checked
Unchecked
), }, { id: "collapsible", name: "Collapsible", description: "Expandable content sections", category: "Layout", preview: (
Expandable Section
Item 1
Item 2
Item 3
), }, { id: "combobox", name: "Combobox", description: "Searchable dropdown selections", category: "Input", preview: (
Select option...
Option 1
Option 2
), }, { id: "command", name: "Command", description: "Command palette interface", category: "Navigation", preview: (
Type a command...
Create new file
Open settings
Search files
), }, { id: "context-menu", name: "Context Menu", description: "Right-click contextual menus", category: "Overlay", preview: (
Copy
Paste
Delete
), }, { id: "dropdowns", name: "Dropdown", description: "Selection menus and options", category: "Input", preview: (
Option 1
Option 2
Option 3
), }, { id: "forms", name: "Form", description: "Data input and validation", category: "Input", preview: (
Enter email...
), }, { id: "hover-card", name: "Hover Card", description: "Content preview on hover", category: "Overlay", preview: (
@username
U
Username
Bio here...
), }, { id: "label", name: "Label", description: "Form field labels and descriptions", category: "Input", preview: (
Input field
Helper text
), }, { id: "modals", name: "Modal", description: "Overlay dialogs and popups", category: "Overlay", preview: (
Modal Title
Modal content goes here...
), }, { id: "pagination", name: "Pagination", description: "Navigate through pages of content", category: "Navigation", preview: (
), }, { id: "progress", name: "Progress", description: "Task completion indicators", category: "Feedback", preview: (
Loading... 65%
Processing files
), }, { id: "scroll-area", name: "Scroll Area", description: "Custom scrollable containers", category: "Layout", preview: (
Item 1
Item 2
Item 3
Item 4
Item 5
), }, { id: "sheet", name: "Sheet", description: "Slide-out panels and drawers", category: "Overlay", preview: (
Sheet Title
Content here...
), }, { id: "sidebar", name: "Sidebar", description: "Navigation and content panels", category: "Layout", preview: (
Menu
Home
About
Contact
Main content area
), }, { id: "skeleton", name: "Skeleton", description: "Loading state placeholders", category: "Feedback", preview: (
), }, { id: "slider", name: "Slider", description: "Range input controls", category: "Input", preview: (
Volume: 65%
), }, { id: "switch", name: "Switch", description: "Toggle controls for binary states", category: "Input", preview: (
Enabled
Disabled
), }, { id: "tabs", name: "Tab", description: "Organize content in tabbed interfaces", category: "Navigation", preview: (
Tab 1
Tab 2
Tab 3
Tab content here...
), }, { id: "tables", name: "Table", description: "Structured data display", category: "Display", preview: (
Name | Status
John | Active
Jane | Pending
Bob | Inactive
), }, { id: "top-navigation", name: "Top Navigation", description: "Header navigation bars", category: "Navigation", preview: (
Logo
Home
About
Contact
U
), }, { id: "tooltips", name: "Tooltip", description: "Contextual help and information", category: "Overlay", preview: (
Tooltip text
), }, ] const categories = ["All", "Input", "Display", "Layout", "Navigation", "Overlay", "Feedback"] export function ComponentsGallerySection() { const [searchTerm, setSearchTerm] = useState("") const [selectedCategory, setSelectedCategory] = useState("All") const filteredComponents = useMemo(() => { return allComponents.filter((component) => { const matchesSearch = component.name.toLowerCase().includes(searchTerm.toLowerCase()) || component.description.toLowerCase().includes(searchTerm.toLowerCase()) const matchesCategory = selectedCategory === "All" || component.category === selectedCategory return matchesSearch && matchesCategory }) }, [searchTerm, selectedCategory]) return (
{/* Header */}

Components

A comprehensive collection of reusable UI components built with React, TypeScript, and Tailwind CSS. Each component is designed with accessibility, customization, and developer experience in mind.

{/* Search and Filter */}
setSearchTerm(e.target.value)} className="pl-10" />
{categories.map((category) => ( ))}
{/* Results count */}
{filteredComponents.length} component{filteredComponents.length !== 1 ? "s" : ""} found
{/* Components Grid */}
{filteredComponents.map((component) => (
{component.name} {component.category}
{/* Component Preview */}
{component.preview}
{component.description}
))}
{/* No results */} {filteredComponents.length === 0 && (

No components found

Try adjusting your search or filter criteria

)}
) }