Merchant dashboardComponents & UI kit

Components & UI kit

The dashboard’s UI lives under src/components. It is organized into three layers:

  1. UI kit — low-level, reusable primitives (src/components/ui).
  2. Feature modules — domain-specific component groups (e.g. product-editor, features, behaviors, intent).
  3. Mobile system — a parallel set of mobile screens and primitives (src/components/mobile) that share the desktop data layer.

Styling convention

  • Tailwind CSS v4 (@tailwindcss/postcss) is the styling system.
  • Class composition goes through a single helper, cn(), in src/lib/utils.ts — it merges clsx conditional classes with tailwind-merge so conflicting Tailwind utilities resolve predictably.
import { cn } from '@/lib/utils'
 
<button className={cn('px-3 py-2', isActive && 'bg-blue-600', className)} />

New components should compose classes with cn() rather than string concatenation, and lean on the UI kit primitives below instead of re-styling raw elements.

UI kit (@/components/ui)

The kit exposes a typed barrel (src/components/ui/index.ts) plus additional primitives imported by path. Barrel exports ship with their prop types:

ComponentExportPurpose
ButtonButton, ButtonPropsPrimary action button
InputInput, InputPropsText input
CardCard, CardHeader, CardTitle, CardDescription, CardContent, CardFooter (+ prop types)Content card family
BadgeBadge, BadgePropsStatus / label pill
AvatarAvatar, AvatarPropsUser / entity avatar
DividerDividerHorizontal rule
LogoLogoBox / brand mark
RefreshButtonRefreshButton, RefreshButtonPropsRefetch trigger
TableEmptyStateTableEmptyState, TableEmptyStatePropsEmpty-table placeholder

Additional primitives in the same directory (imported by path, e.g. @/components/ui/data-table):

AreaPrimitives
Tablestable, data-table, table-pagination, table-empty-state
Overlaysdialog, alert-dialog
Formsselect, currency-input, pricing-fields, date-range-filter, collection-picker, form-stepper-panel, settings-field-renderer
Mediasortable-gallery, image-upload, image-upload-modal
Feedbackskeleton, page-skeletons, boxes-loader, use-toast, inline-delete-button
Layoutseparator, divider, tab-nav

Feature modules

Domain UI is grouped into feature folders under src/components. Each owns the composite components for a slice of the dashboard:

ModuleResponsibility
product-editorThe multi-step product/catalog editor (sections, sidebar, mobile variant)
featuresFeature-toggle forms and capability configuration
behaviorsProduct behavior configuration (subscribable, bookable, gating, etc.)
intentBusiness-intent selection and switching
customer-editor / customersCustomer create/edit and CRM views
invoice-editorInvoice builder
plan-editorSubscription plan builder
discount-editorDiscount builder
collection-editorCollection builder
template-editorStorefront template editor
editor-sharedShared editor scaffolding
storefront-preview / preview-layoutLive storefront preview surfaces
command-paletteGlobal command palette overlay
analyticsAnalytics dashboards
authAuth flow components
dashboardHome / “Today” widgets and empty states
sharedCross-feature helpers

Top-level shared components include the desktop sidebar.tsx (which builds intent-driven navigation), workspace-switcher, feedback-widget, dynamic-form, and the mobile-bottom-nav.

Mobile system

The mobile experience is delivered on the same routes as desktop (see App architecture). It has its own component system under src/components/mobile:

  • Screens (mobile/screens/*) — one mobile body per route, rendered inside a md:hidden wrapper while the desktop body stays in hidden md:block.
  • Primitives (mobile/primitives/*) — bottom-sheet, chrome, layout, inputs, inline, progressive-list, sticky-cta-bar, intent-switcher, domain.
  • ChromeMobileShell, mobile-nav-bar, nav-group, mounted from the dashboard layout on small viewports.
⚠️

The mobile screens follow a strict visual contract: each screen must match its mockup in mobile-redesign-mockups.tsx, use only mobile/primitives/*, and use theme tokens (tokens.* / lightTokens.* or var(--mb-*)) — never hardcoded hex. The accent is always #116DFF (Potter brand). See the dashboard repo’s AGENTS.md for the full mobile contract.