Button Component Audit

Side-by-side comparison of @medlo/ui/button and the local @/components/ui/button used across apps/doccy. Built to review visual discordance and help consolidate on one implementation.

Import Distribution

@medlo/ui/buttonshared

54 files

Newer, shared package. Used in checkout flow, partner pages, public pages, and newer dashboard components.

@/components/ui/buttonlocal

107 files

Original local button. Dominates dashboard, medical tabs, overlays, forms, marketing pages, and login.

Discordance areas: The same dashboard routes mix both imports. For example, send-receipt-button.tsx uses @medlo/ui while sibling components like help-panel.tsx and base-consult-details.tsx use the local button. This creates inconsistent border-radius, focus rings, and sizing.

Key Differences

Property@medlo/ui/buttonLocal button
Default variantprimarydefault
Default sizemddefault
Default heighth-9 (36px)h-10 (40px)
Border radiusrounded-lg / rounded-xlrounded-md / rounded-sm
Focus ringring-1, no offsetring-2, ring-offset-2
Base classesNo cursor-pointer, no text-leftcursor-pointer text-left
Outline shadowshadow-xsnone
Unique variantssoftAmber, blueNoBg, limeGreenamberLight

@medlo/ui/button — All Variants

Shared package button. Default: variant="primary" size="md"

Sizes

xs
sm
md
lg
icon

Disabled

Local button — All Variants

apps/doccy local button. Default: variant="default" size="default"

Sizes

xs
sm
default
lg
icon

Disabled

Side-by-Side Comparison

Identical props applied to both implementations. Look for differences in border-radius, height, focus rings, and shadow.

Primary / Default (no variant prop)

@medlo/ui
Local

variant="outline" size="sm"

@medlo/ui
Local

variant="ghost" size="sm"

@medlo/ui
Local

variant="destructive"

@medlo/ui
Local

variant="secondary" size="sm"

@medlo/ui
Local

size="lg" (full width CTA)

@medlo/ui
Local

variant="outline" size="sm" className="rounded-xl"

@medlo/ui
Local

Shared variants

@medlo/ui
Local

Real Usage Patterns from apps/doccy

Extracted from public, checkout, and /dashboard routes (admin excluded). Shows the actual component, variant, and import source used in production.

Login Page

pages/login.tsx

local

Checkout Flow

pages/payment/checkout.tsx

@medlo/ui

Med Cert Form: Leave Category (Radio Buttons)

patient-medical-form/1-leave-category-form.tsx

local

Med Cert Form: Personal Info Submit

patient-medical-form/personal-info/profile-form-phase.tsx

@medlo/ui

Med Cert Form: Phone Entry + OTP

patient-medical-form/personal-info/phone-entry-phase.tsx

@medlo/ui

Med Cert Form: Sign-in Nudge

patient-medical-form/sign-in-nudge.tsx

@medlo/ui

Dashboard: Quick Actions

dashboard/quick-actions/quick-actions.tsx

local

Dashboard: Overlay / Dialog Actions

dashboard/*/add-edit-*-overlay.tsx, confirm-delete-*.tsx

local

Dashboard: Error Retry Pattern

dashboard/consult-details/base-consult-details.tsx

local

Failed to load details

Dashboard: Account Page

pages/dashboard/account.tsx

local

Landing / Marketing Pages

lp/services/service-single-pricing.tsx, medical-certificate/*.tsx

local

Setup Page

pages/setup.tsx

@medlo/ui

Dashboard: Medical Records Tabs

dashboard/medical/*.tsx

local

Dashboard: Consult Decision Card

dashboard/consult-details/consult-decision-card.tsx

local

Explicit Consent Blocker

components/explicit-consent-blocker.tsx

@medlo/ui

Dashboard: Contact Verification OTP

dashboard/consult-flow/contact-details-summary.tsx

local

Import Source by Route Area (non-admin)

Route area@medlo/ui/buttonLocal buttonNotes
pages/login, login-doctor02All local
pages/setup, setup-final11Split
pages/payment/*32Checkout uses @medlo/ui, success uses local
pages/medical-certificate/*04All local
pages/dashboard/*02All local
components/patient-medical-form/*54Mixed: personal-info phases use @medlo/ui, form steps use local
components/dashboard/quick-actions01Local
components/dashboard/consult-details/*15send-receipt uses @medlo/ui, all others local
components/dashboard/consult-flow/*05All local
components/dashboard/medical/*011All local
components/dashboard/lifestyle/*03All local
components/dashboard/patient/*03All local
components/lp/services/*03All local
components/marketing-*02All local
components/live-media/*04All local
components/nav/*02All local
components/ (root level)48Mixed

Consolidation Considerations

1. Default height mismatch: @medlo/ui default is h-9 (36px), local is h-10 (40px). Consolidating would shift layout in many dashboard components.

2. Border radius divergence: @medlo/ui uses rounded-lg/xl, local uses rounded-md/sm. The sharper local corners appear throughout the dashboard; the rounder @medlo/ui corners appear in checkout and newer flows.

3. Focus ring style: @medlo/ui uses ring-1 (thinner, no offset), local uses ring-2 with offset-2. Accessibility implications worth checking.

4. Unique variants: @medlo/ui has limeGreen, softAmber, blueNoBg not in local. Local has amberLight not in @medlo/ui. Migration needs these to exist in the target.

5. cursor-pointer in base: Local button adds cursor-pointer and text-left to base styles. @medlo/ui omits these. Consolidating to @medlo/ui would lose explicit cursor-pointer (though Tailwind v4 base already sets it on buttons).