Skip to main content

Component Patterns

This page documents the standard component patterns used across HostMetrics. All components follow the project’s muted, elegant aesthetic using exact hex values — never generic Tailwind color classes.

Cards / Widgets

The standard card is the most common container in the app:
Key details:
  • Background: bg-white
  • Border: border border-[#e8e6e1]
  • Border radius: rounded-xl
  • Header padding: px-5 py-4
  • Body padding: p-5
  • Header divider: border-b border-[#e8e6e1]

Tables

Tables follow a consistent structure with muted headers and hover states:
Key details:
  • Header background: bg-[#fafaf8]
  • Header text: text-xs font-medium text-[#8c8c8c] uppercase tracking-wide
  • Cell padding: px-4 py-3
  • Cell text: text-sm text-[#4a4a4a]
  • Row dividers: divide-y divide-[#e8e6e1]
  • Hover state: hover:bg-[#f0efe9]

Status Badges

Four badge variants cover all status states in the app:

Success / Positive

Used for: matched, completed, overpaid, active.

Error / Negative

Used for: failed, underpaid, critical, overdue.

Warning / Pending

Used for: pending, in progress, expiring soon.

Neutral / Info

Used for: inactive, informational, default.

Badge Summary Table

VariantBackgroundText ColorUse Cases
Success#f0f5ed#6b7c5cCompleted, matched, active, overpaid
Error#fef2f2#b45454Failed, overdue, underpaid, critical
Warning#f5f0e6#8b7355Pending, in progress, expiring
Neutral#fafaf8#8c8c8cInactive, info, default

Buttons

Primary Action

Secondary / Outline

Destructive

Currency Display

Currency values use consistent formatting with color-coded positive/negative amounts:
Always apply tabular-nums for proper alignment in tables and lists. Use the shared currency formatter:

Empty States

When a table or list has no data, show a centered message:

Loading States

Use skeleton placeholders that match the content layout:

Form Inputs

Form fields use the shadcn/ui Input and Label components with consistent styling: