Skip to main content

UI Component Library Reference

The Ever Works template includes a comprehensive UI component library located in components/ui/. These are shared, reusable components used across public pages, client dashboard, and admin interfaces. Many are built on top of shadcn/ui primitives and styled with Tailwind CSS.

Component Inventory

The library contains over 40 components organized by function:

Form Inputs

ComponentFileDescription
Inputinput.tsxStandard text input with variants
Textareatextarea.tsxMulti-line text input
Labellabel.tsxForm field label with required indicator
Selectselect.tsxDropdown select built on shadcn/ui Select
SearchableSelectsearchable-select.tsxSelect with search/filter functionality
SearchInputsearch-input.tsxInput with search icon and debounced onChange
Switchswitch.tsxToggle switch for boolean values
PasswordStrengthpassword-strength.tsxVisual password strength indicator

Multi-Step Form System

Located in components/ui/multi-step-form/:

ComponentFileDescription
StepContainerstep-container.tsxWrapper for individual form steps
StepIndicatorstep-indicator.tsxVisual progress showing completed/active/pending steps
StepNavigationstep-navigation.tsxPrevious/Next/Submit navigation buttons

Used by the admin item form and client form for multi-step creation workflows.

Layout & Container

ComponentFileDescription
Cardcard.tsxCard container with header, content, and footer sections
Containercontainer.tsxResponsive content container with configurable max-width
ResponsiveContainerresponsive-container.tsxContainer with element-level responsive queries
Separatorseparator.tsxHorizontal or vertical visual separator
StickyHeadersticky-header.tsxHeader that sticks to top on scroll

Feedback & Status

ComponentFileDescription
Alertalert.tsxAlert banner with variant styles (default, destructive)
Badgebadge.tsxSmall status badge with color variants
Toasttoast.tsxTemporary notification toast
Toastertoaster.tsxToast container and management
LoadingSpinnerloading-spinner.tsxAnimated loading indicator
Skeletonskeleton.tsxContent placeholder for loading states
TopLoadingBartop-loading-bar.tsxThin progress bar at page top during navigation
DatabaseStatusWarningdatabase-status-warning.tsxWarning banner when DATABASE_URL is missing
ComponentFileDescription
Buttonbutton.tsxButton with multiple variants (default, destructive, outline, secondary, ghost, link) and sizes
Breadcrumbbreadcrumb.tsxHierarchical navigation breadcrumb trail
Paginationpagination.tsxPage navigation with numbered pages and prev/next
InfinityScrollinfinity-scroll.tsxInfinite scroll trigger using Intersection Observer
ToggleGrouptoggle-group.tsxGroup of toggle buttons (single or multi-select)
SegmentedTogglesegmented-toggle.tsxSegmented control for switching between options

Overlay & Modal

ComponentFileDescription
Modalmodal.tsxDialog overlay with title, content, and action buttons
Popoverpopover.tsxFloating content panel triggered by a button
Accordionaccordion.tsxCollapsible content sections

Data Display

ComponentFileDescription
Ratingrating.tsxStar rating display and input component
DistanceBadgedistance-badge.tsxLocation distance indicator badge

Specialized Selectors

ComponentFileDescription
SelectLayoutselect-layout.tsxContent layout selector (classic, grid, cards, masonry)
SelectContainerWidthselect-container-width.tsxContainer width configuration
SelectPaginationTypeselect-pagination-type.tsxPagination style selector
SelectDatabaseModeselect-database-mode.tsxDatabase mode configuration
SelectCheckoutProviderselect-checkout-provider.tsxPayment provider selector

Accessibility

ComponentFileDescription
Accessibilityaccessibility.tsxAccessibility utility components and helpers

Animation & Visual

ComponentFileDescription
Animationsanimations.tsxReusable animation wrappers (fade, slide, scale)
AuthIllustrationsauth-illustrations.tsxSVG illustrations for auth pages

Payment

ComponentFileDescription
StripeComponentsstripe-components.tsxStripe Elements wrappers for payment forms

shadcn/ui Integration

The component library extends shadcn/ui primitives with project-specific styling and behavior. The integration approach:

  1. Base components from shadcn/ui -- Button, Card, Input, Select, Switch, Badge, Alert, Accordion, Popover, Separator, Skeleton, Label, Textarea, Toggle Group
  2. Custom extensions -- Components like SearchableSelect, InfinityScroll, Rating, MultiStepForm add functionality beyond the base library
  3. Consistent theming -- All components use CSS variables for theming, supporting both light and dark modes

Tailwind CSS Configuration

The template uses Tailwind CSS with the following customizations:

  • Dark mode -- Class-based dark mode (darkMode: 'class')
  • CSS variables -- Colors are defined as CSS variables for theme switching
  • Custom utilities -- Extended spacing, typography, and animation utilities
  • Responsive breakpoints -- Standard Tailwind breakpoints with mobile-first approach

Color System

Colors are defined as CSS variables and mapped to Tailwind utility classes:

/* Light mode */
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--primary: 222.2 47.4% 11.2%;
--secondary: 210 40% 96.1%;
--destructive: 0 84.2% 60.2%;
--muted: 210 40% 96.1%;
--accent: 210 40% 96.1%;

/* Dark mode */
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
/* ... */

Usage Patterns

Basic Component Usage

import { Button } from '@/components/ui/button';
import { Card } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';

function MyComponent() {
return (
<Card>
<Card.Header>
<Card.Title>Item Title</Card.Title>
</Card.Header>
<Card.Content>
<Badge variant="secondary">Published</Badge>
<p>Item description here.</p>
</Card.Content>
<Card.Footer>
<Button variant="outline">Edit</Button>
<Button>Save</Button>
</Card.Footer>
</Card>
);
}

Multi-Step Form

import {
StepContainer,
StepIndicator,
StepNavigation,
} from '@/components/ui/multi-step-form';

function CreateItemForm() {
const [step, setStep] = useState(0);
const steps = ['Basic Info', 'Classification', 'Location', 'Media', 'Review'];

return (
<div>
<StepIndicator steps={steps} currentStep={step} />
<StepContainer>
{step === 0 && <BasicInfoStep />}
{step === 1 && <ClassificationStep />}
{/* ... */}
</StepContainer>
<StepNavigation
currentStep={step}
totalSteps={steps.length}
onPrevious={() => setStep(s => s - 1)}
onNext={() => setStep(s => s + 1)}
onSubmit={handleSubmit}
/>
</div>
);
}

Infinite Scroll

import { InfinityScroll } from '@/components/ui/infinity-scroll';

function ItemList() {
return (
<div>
{items.map(item => <ItemCard key={item.id} item={item} />)}
<InfinityScroll
hasMore={hasNextPage}
isLoading={isFetchingNextPage}
onLoadMore={fetchNextPage}
/>
</div>
);
}
  • components/ui/ -- All shared UI components
  • components/ui/multi-step-form/ -- Multi-step form system
  • tailwind.config.ts -- Tailwind CSS configuration
  • app/globals.css -- Global CSS with theme variables