Skip to content

Components

IndieStack provides a three-layer component architecture: base UI (shadcn/ui), shared business components, and page-level components.

Directory Structure

src/components/
├── ui/             # Base UI (shadcn/ui, 24 components)
├── shared/         # Shared business components (11)
├── layout/         # Layout components (5)
├── auth/           # Auth components (2)
├── dashboard/      # Dashboard components
├── charts/         # Charts (Recharts)
├── forms/          # Form components (5)
├── data-tables/    # Tables (@tanstack/react-table)
└── providers/      # React Context Providers

shadcn/ui (24 components)

All built on Radix UI primitives with accessibility and theme support.

ComponentUsageRadix Base
Button6 variants@radix-ui/react-slot
CardCard container-
DialogModal dialog@radix-ui/react-dialog
DropdownMenuDropdown@radix-ui/react-dropdown-menu
InputText input-
SelectSelect with search@radix-ui/react-select
TabsTab switching@radix-ui/react-tabs
TableData table-
ToastNotifications@radix-ui/react-toast
TooltipTooltip@radix-ui/react-tooltip
AvatarAvatar@radix-ui/react-avatar
BadgeBadge-
SwitchToggle@radix-ui/react-switch
CheckboxCheckbox@radix-ui/react-checkbox
Alert5 variants-
Sheet4 directions@radix-ui/react-dialog
SkeletonLoading-
SeparatorDivider@radix-ui/react-separator
TextareaText area-
ToggleToggle button@radix-ui/react-toggle
ProgressProgress bar@radix-ui/react-progress
LabelLabel@radix-ui/react-label
PopoverPopover@radix-ui/react-popover
CollapsibleCollapsible@radix-ui/react-collapsible

Custom Components

ComponentDirectoryUsage
SiteHeaderlayout/Responsive navbar with auth state, theme + locale switcher
SiteFooterlayout/Page footer with links and copyright
DashboardSidebarlayout/Collapsible sidebar with role-based menu
ThemeTogglelayout/Light/dark theme toggle
LocaleSwitcherlayout/Chinese/English language switcher
PermissionGateshared/Role-based permission guard for UI elements
ConfirmDialogshared/Generic confirmation dialog
Breadcrumbsshared/Auto breadcrumb navigation
EmptyStateshared/Empty state (icon + title + desc + action)
LoadingStateshared/Generic loading skeleton
ErrorStateshared/Error state with retry button
SearchInputshared/Debounced search input
PageContainershared/Uniform page container
PageHeadershared/Page header with action slot
PageLoadershared/Full-screen loading indicator
Sectionshared/Content section wrapper
StatsCarddashboard/Stats card with trend indicator
DataTabledata-tables/Generic table (sort/search/pagination)
AreaChartcharts/Area chart (Recharts)
LoginFormauth/Email + OAuth login form
RegisterFormauth/Registration form
ProfileEditFormforms/Profile edit form
InviteMemberFormforms/Invite team member form
PasswordFormforms/Change password form
NotificationSettingsFormforms/Notification preferences form

Component Principles

  1. UI (ui/): Presentational only, no business logic
  2. Shared (shared/): Reusable, page-agnostic common logic
  3. Business (forms/, dashboard/): Domain-specific, uses shared components
  4. Pages (app/): Composes business + UI components
  5. Use useTranslations (client) or getTranslations (server) for i18n
  6. Theme support via cn() utility and Tailwind CSS variables

基于 MIT 协议开源