Frontend

Component Library

A guide to the building blocks of the BizTech frontend: our UI primitives, shared components, and how they're organized.


Component Organization

Components live in src/components/ and are organized by feature area, not by type. Here's the mental model:

src/components/
├── ui/Low-level primitives (shadcn/ui + custom)
├── Common/Shared across many pages
├── NavBar/App shell navigation
├── EventCard/Event browsing cards
├── Events/Event creation/editing forms
├── EventsDashboard/Admin event dashboard
├── RegistrationTable/Data table for registrations
├── Companion/Companion app components
├── Connections/Connection history
├── LiveWall/Real-time connection walls
├── SignUpForm/Membership signup
├── QrScanner/QR scanning
├── QrCodeCompanion/QR companion interactions
├── NFCWrite/NFC tag writing (admin)
├── Blocks/Content blocks (hero, footer)
├── Loading.tsxLoading spinner
└── ConfigureAmplify.tsxAmplify initialization

Rule of Thumb

If a component is used by only one page, it can live in that page's feature directory (src/features/). If it's shared across pages, it belongs in src/components/.


UI Primitives (src/components/ui/)

These are our building blocks. Most come from shadcn/ui and are built on Radix UI primitives. They're unstyled by default and use Tailwind for styling.

Commonly Used Components

ComponentImportUsage
Button@/components/ui/buttonPrimary actions, with variants: default, outline, ghost, destructive
Dialog@/components/ui/dialogModal dialogs (confirmations, forms)
Select@/components/ui/selectDropdown selects
Input@/components/ui/inputText inputs
Tabs@/components/ui/tabsTab navigation
Table@/components/ui/tableData tables
Toast@/components/ui/toastNotification toasts
Form@/components/ui/formreact-hook-form integration
Skeleton@/components/ui/skeletonLoading placeholders
Spinner@/components/ui/spinnerLoading spinner
DropdownMenu@/components/ui/dropdown-menuContext menus
AlertDialog@/components/ui/alert-dialogConfirmation dialogs

Custom UI Components

Beyond shadcn, we have custom primitives:

ComponentPurpose
GradientTextText with gradient styling
AnimatedBorderAnimated border effects
CompanionButtonStyled button for companion UIs
CompanionItemRowList item row for companion UIs
ConnectedButtonConnection action button
SectionCardCard with icon + title header (used in dashboards)

Adding a New shadcn Component

npx shadcn-ui@latest add [component-name]

This generates the component in src/components/ui/ with proper Tailwind styling. You can then customize it freely.


Common Components (src/components/Common/)

Shared components used across multiple pages:

ComponentWhat It Does
SearchBarReusable search input with debounce
PaginationPage navigation for tables and lists
GenericCardBase card component with consistent styling
FilterSelectDropdown filter for data views
ConfirmDialogReusable confirmation modal
EmptyState"No data" placeholder with icon
Previous
Styling & Configuration