# Responsive Design Guide ## Document Overview This document defines responsive design patterns, breakpoints, and mobile-first strategies for ColaFlow's multi-tenant, SSO, and MCP Token management features. **Version:** 1.0 **Last Updated:** 2025-11-03 **Tech Stack:** Tailwind CSS 4 + Next.js 16 (App Router) **Owner:** UX/UI Team --- ## Table of Contents 1. [Breakpoint System](#breakpoint-system) 2. [Mobile-First Approach](#mobile-first-approach) 3. [Registration Flow Responsive Patterns](#registration-flow-responsive-patterns) 4. [Login Pages Responsive Design](#login-pages-responsive-design) 5. [SSO Configuration Responsive Layout](#sso-configuration-responsive-layout) 6. [MCP Token Management Mobile Views](#mcp-token-management-mobile-views) 7. [Component Adaptations](#component-adaptations) 8. [Performance Considerations](#performance-considerations) --- ## Breakpoint System ### Tailwind CSS Breakpoints Following Tailwind's default breakpoints with custom extensions: ```typescript // tailwind.config.ts const screens = { 'xs': '480px', // Extra small devices (large phones) 'sm': '640px', // Small devices (tablets) 'md': '768px', // Medium devices (landscape tablets) 'lg': '1024px', // Large devices (laptops) 'xl': '1280px', // Extra large devices (desktops) '2xl': '1536px', // 2X large devices (large desktops) } ``` ### Device Categories | Breakpoint | Range | Device Type | Typical Width | |------------|-------|-------------|---------------| | **xs** | 480px - 639px | Large phones | 480px - 640px | | **sm** | 640px - 767px | Small tablets | 640px - 768px | | **md** | 768px - 1023px | Tablets | 768px - 1024px | | **lg** | 1024px - 1279px | Laptops | 1024px - 1280px | | **xl** | 1280px - 1535px | Desktops | 1280px - 1536px | | **2xl** | 1536px+ | Large desktops | 1536px+ | ### Container Max-Widths ```typescript // Container sizes per breakpoint const container = { center: true, padding: { DEFAULT: '1rem', // 16px sm: '2rem', // 32px lg: '4rem', // 64px xl: '5rem', // 80px '2xl': '6rem', // 96px }, screens: { sm: '640px', md: '768px', lg: '1024px', xl: '1280px', '2xl': '1536px', }, } ``` --- ## Mobile-First Approach ### Core Principles 1. **Start with mobile** (320px+) as the base 2. **Progressive enhancement** for larger screens 3. **Touch-friendly** targets (min 44x44px) 4. **Readable typography** (min 16px body text) 5. **Simplified navigation** on small screens ### Example Pattern ```tsx // Mobile-first Tailwind classes
{/* Content */}
``` ### CSS Custom Properties ```css :root { --spacing-mobile: 16px; --spacing-tablet: 24px; --spacing-desktop: 32px; --font-size-mobile: 14px; --font-size-tablet: 15px; --font-size-desktop: 16px; } ``` --- ## Registration Flow Responsive Patterns ### Multi-Step Form Layout #### Desktop (lg+) ``` ┌───────────────────────────────────────────┐ │ [Logo] Step 1 of 3 │ ├───────────────────────────────────────────┤ │ │ │ Company Information │ │ │ │ [ ] │ │ [ ] │ │ │ │ [Cancel] [Next →] │ │ │ └───────────────────────────────────────────┘ ``` - Width: 600px max-width, centered - Padding: 64px - Form fields: Full width, 24px gap - Buttons: Right-aligned, 160px width #### Tablet (md) ``` ┌─────────────────────────────────┐ │ [Logo] Step 1 of 3 │ ├─────────────────────────────────┤ │ │ │ Company Information │ │ │ │ [ ] │ │ [ ] │ │ │ │ [Cancel] [Next →] │ │ │ └─────────────────────────────────┘ ``` - Width: 480px max-width, centered - Padding: 48px - Form fields: Full width, 20px gap - Buttons: Right-aligned, 140px width #### Mobile (< sm) ``` ┌─────────────────────────┐ │ [≡] Step 1 of 3 │ ├─────────────────────────┤ │ │ │ Company Info │ │ │ │ [ ] │ │ [ ] │ │ │ │ [Cancel] │ │ [Next →] │ │ │ └─────────────────────────┘ ``` - Width: Full width with 16px padding - Progress: Compact dots only - Fields: Stacked, full width, 16px gap - Buttons: Stacked, full width, 12px gap - Secondary button above primary **Implementation:** ```tsx
{/* Form content */}
{/* Fields */}
{/* Buttons */}
``` --- ### Tenant Slug Preview #### Desktop ``` Company Slug * [acme ] ✓ acme.colaflow.com is available ``` #### Mobile ``` Company Slug * [acme ] ✓ Available ``` - Hide full domain, show only "Available" / "Taken" - Tap to view full domain in bottom sheet **Implementation:** ```tsx
{/* Desktop preview */}

✓ {slug}.colaflow.com is available

{/* Mobile preview */}

✓ Available

``` --- ### Subscription Plan Cards #### Desktop (lg+) ``` ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ Free │ │ Starter │ │ Pro │ │Enterprise│ │ $0 │ │ $19 │ │ $49 │ │ Custom │ │ ... │ │ ... │ │ ... │ │ ... │ │ [Start] │ │ [Start] │ │ [Start] │ │[Contact]│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ ``` - 4 columns, equal width - Side-by-side comparison #### Tablet (md) ``` ┌───────────┐ ┌───────────┐ │ Free │ │ Starter │ │ $0 │ │ $19 │ │ ... │ │ ... │ │ [Start] │ │ [Start] │ └───────────┘ └───────────┘ ┌───────────┐ ┌───────────┐ │ Pro │ │Enterprise │ │ $49 │ │ Custom │ │ ... │ │ ... │ │ [Start] │ │ [Contact] │ └───────────┘ └───────────┘ ``` - 2 columns, 2 rows - Grid layout #### Mobile (< sm) ``` ┌───────────────┐ │ Free │ │ $0 │ │ ... │ │ [Start] │ └───────────────┘ ┌───────────────┐ │ Starter │ │ $19 │ │ ... │ │ [Start] │ └───────────────┘ ``` - 1 column, scrollable - Cards stacked vertically - "Compare Plans" button to show comparison table **Implementation:** ```tsx
{plans.map(plan => ( ))}
``` --- ## Login Pages Responsive Design ### Login Form Layout #### Desktop (md+) ``` ┌──────────────────────────────────────┐ │ │ │ Welcome to Acme Corp │ │ │ │ Email Address │ │ [ ] │ │ │ │ Password │ │ [ ] │ │ │ │ [☐] Remember me Forgot password? │ │ │ │ [Sign In →] │ │ │ │ ────── OR ────── │ │ │ │ [🟦 Continue with Microsoft] │ │ [🔴 Continue with Google] │ │ │ └──────────────────────────────────────┘ ``` - Max-width: 448px, centered - Vertical spacing: 24px - SSO buttons: full width #### Mobile (< md) ``` ┌────────────────────┐ │ │ │ Welcome │ │ │ │ Email │ │ [ ] │ │ │ │ Password │ │ [ ] │ │ │ │ [☐] Remember me │ │ Forgot password? │ │ │ │ [Sign In →] │ │ │ │ ─── OR ─── │ │ │ │ [Microsoft] │ │ [Google] │ │ │ └────────────────────┘ ``` - Full width with 16px padding - Smaller fonts (14px body) - Compact spacing (16px) - "Remember me" and "Forgot password" stacked **Implementation:** ```tsx

Welcome to {tenantName}

{/* SSO buttons (if configured) */} {ssoEnabled && (
)} {ssoEnabled && } {/* Local login form */}
Forgot password?
``` --- ### SSO Button Responsive Sizing #### Desktop ``` [🟦 Continue with Microsoft] │ 24px gap │ ``` - Height: 48px - Padding: 12px 24px - Icon: 20x20px - Font: 16px #### Mobile ``` [🟦 Microsoft] │ 12px │ ``` - Height: 44px (touch-friendly) - Padding: 12px 16px - Icon: 18x18px - Font: 14px - Shorter text: "Microsoft" instead of "Continue with Microsoft" **Implementation:** ```tsx ``` --- ## SSO Configuration Responsive Layout ### Settings Page Structure #### Desktop (lg+) ``` ┌─────────────────────────────────────────────────────┐ │ Settings │ ├───────────┬─────────────────────────────────────────┤ │ │ │ │ General │ Single Sign-On (SSO) │ │ SSO │ │ │ Billing │ ┌──────────────────────────────────┐ │ │ Usage │ │ General │ │ │ Team │ │ OIDC Config │ │ │ │ │ SAML Config │ │ │ │ │ Users │ │ │ │ │ Test │ │ │ │ └──────────────────────────────────┘ │ │ │ │ │ │ [Tab content...] │ │ │ │ └───────────┴─────────────────────────────────────────┘ ``` - Sidebar: 240px fixed width - Content: Flexible, max-width 800px - Tabs: Horizontal #### Tablet (md) ``` ┌─────────────────────────────────┐ │ Settings [≡] │ ├─────────────────────────────────┤ │ │ │ Single Sign-On (SSO) │ │ │ │ ┌─────────────────────────┐ │ │ │ General │ │ │ │ OIDC Config │ │ │ │ SAML Config │ │ │ │ Users │ │ │ │ Test │ │ │ └─────────────────────────┘ │ │ │ │ [Tab content...] │ │ │ └─────────────────────────────────┘ ``` - No sidebar (hamburger menu) - Content: Full width with padding - Tabs: Scrollable horizontal #### Mobile (< sm) ``` ┌───────────────────┐ │ SSO Config [≡] │ ├───────────────────┤ │ │ │ [General ▼] │ │ │ │ [Tab content...] │ │ │ │ [Save] │ │ │ └───────────────────┘ ``` - No sidebar - Tabs: Dropdown select - Sticky footer with save button - Forms: Stacked fields **Implementation:** ```tsx
{/* Sidebar (desktop only) */} {/* Mobile header with menu */}

SSO Configuration

{/* Main content */}
{/* Desktop tabs */} General OIDC Config SAML Config Users Test {/* Mobile dropdown */} {/* Tab content */}
{tabContent}
``` --- ### Form Fields Responsive Stack #### Desktop ``` Authority / Issuer URL * [ ] Client ID * [ ] Client Secret * [ ] ``` - Single column - Full width inputs - 24px vertical gap #### Mobile ``` Authority * [ ] Client ID * [ ] Secret * [ ] ``` - Shorter labels - Smaller inputs - 16px vertical gap - Multiline inputs collapse to single line **Implementation:** ```tsx
Authority / Issuer URL Authority } required /> Client Secret Secret } type="password" required />
``` --- ## MCP Token Management Mobile Views ### Token List Responsive Cards #### Desktop (md+) ``` ┌────────────────────────────────────────────────┐ │ Claude Desktop [Active] │ │ Permissions: Projects (R), Issues (R/W) │ │ Created: Nov 1 • Last Used: 2 hours ago │ │ Expires: In 30 days │ │ │ │ [View Details] [Revoke] │ └────────────────────────────────────────────────┘ ``` - Horizontal card - All info visible - Buttons inline #### Mobile (< md) ``` ┌──────────────────────────┐ │ Claude Desktop [●] │ │ │ │ Projects (R) │ │ Issues (R/W) │ │ +2 more │ │ │ │ Last used: 2h ago │ │ Expires: 30d │ │ │ │ [Details] [Revoke] │ └──────────────────────────┘ ``` - Vertical card - Compact info - Abbreviated permissions - Buttons full width **Implementation:** ```tsx
{/* Header */}

{token.name}

{/* Permissions - desktop */}
{formatPermissions(token.permissions)}
{/* Permissions - mobile (compact) */}
{token.permissions.slice(0, 2).map(p => (
{p}
))} {token.permissions.length > 2 && (
+{token.permissions.length - 2} more
)}
{/* Metadata */}
Created: {formatDate(token.createdAt)} Last used: {formatRelativeTime(token.lastUsedAt)} Expires: {formatExpiry(token.expiresAt)}
{/* Actions */}
``` --- ### Permission Matrix Mobile Adaptation #### Desktop ``` ┌──────────────────────────────────────────────────┐ │ Resource │ Read │Create│Update│Delete│Search │ │───────────┼──────┼──────┼──────┼──────┼────────│ │ Projects │ ✓ │ │ │ │ ✓ │ │ Issues │ ✓ │ ✓ │ ✓ │ │ ✓ │ │ Documents │ ✓ │ ✓ │ │ │ ✓ │ └──────────────────────────────────────────────────┘ ``` - Full table view - All columns visible - Checkboxes #### Mobile (< md) ``` ┌─────────────────────────┐ │ [Projects ▼] │ │ ☑ Read │ │ ☐ Create │ │ ☐ Update │ │ ☐ Delete │ │ ☑ Search │ ├─────────────────────────┤ │ [Issues ▼] │ │ ☑ Read │ │ ☑ Create │ │ ☑ Update │ │ ☐ Delete │ │ ☑ Search │ └─────────────────────────┘ ``` - Accordion view - One resource at a time - Larger touch targets - Checkbox list **Implementation:** ```tsx // Desktop view {resources.map(resource => ( {operations.map(op => ( ))} ))}
Resource Read Create Update Delete Search
{resource}
// Mobile view (accordion)
{resources.map(resource => ( {resource} ({selectedCount(resource)} selected)
{operations.map(op => ( ))}
))}
``` --- ### Audit Log Table Mobile Adaptation #### Desktop ``` ┌────────────────────────────────────────────────────┐ │ Timestamp Action Resource Result IP │ │────────────────────────────────────────────────────│ │ Nov 3, 08:15 Read Issue #123 Success 192.168 │ │ Nov 3, 08:10 Create Issue #456 Success 192.168 │ └────────────────────────────────────────────────────┘ ``` - Table layout - All columns visible - Horizontal scroll if needed #### Mobile ``` ┌────────────────────────┐ │ Nov 3, 08:15 AM │ │ Read Issue #123 │ │ Success • 192.168.1.1 │ ├────────────────────────┤ │ Nov 3, 08:10 AM │ │ Create Issue #456 │ │ Success • 192.168.1.1 │ └────────────────────────┘ ``` - Card layout - Stacked information - Tap to expand details **Implementation:** ```tsx // Desktop table {logs.map(log => ( ))}
Timestamp Action Resource Result IP Address
{formatTimestamp(log.timestamp)} {log.action} {log.resource} {log.ipAddress}
// Mobile cards
{logs.map(log => ( ))}
``` --- ## Component Adaptations ### Modal to Bottom Sheet On mobile, full-screen modals become bottom sheets for better UX. #### Desktop Modal ``` [Backdrop] ┌──────────────┐ │ Modal │ │ Content │ │ │ │ [Actions] │ └──────────────┘ ``` #### Mobile Bottom Sheet ``` ┌──────────────────┐ │ │ │ Page content │ │ │ ├──────────────────┤ <- Swipe up │ [Handle] │ │ │ │ Sheet Content │ │ │ │ [Actions] │ └──────────────────┘ ``` **Implementation:** ```tsx {/* Drag handle (mobile only) */}
{content}
``` --- ### Dropdown to Drawer Complex dropdowns become side drawers on mobile. #### Desktop Dropdown ``` [Select Provider ▼] │ ├─ Azure AD ├─ Google ├─ Okta └─ SAML ``` #### Mobile Drawer ``` ┌──────────────────┐ │ │ │ Page │ │ │ │ [Select ▼] │ │ │ └──────────────────┘ ↓ ┌──────────────────┐ │ [× ] Provider │ ├──────────────────┤ │ │ │ ○ Azure AD │ │ ○ Google │ │ ○ Okta │ │ ● SAML │ │ │ │ [Confirm] │ └──────────────────┘ ``` **Implementation:** ```tsx // Desktop: native select or dropdown // Mobile: drawer setDrawerOpen(false)}> Select Provider
{options.map(opt => ( ))}
``` --- ## Performance Considerations ### Image Optimization ```tsx import Image from 'next/image'; ColaFlow ``` ### Lazy Loading ```tsx import dynamic from 'next/dynamic'; // Load heavy components only when needed const PermissionMatrix = dynamic( () => import('@/components/mcp-tokens/PermissionMatrix'), { loading: () => } ); // Mobile-specific components const MobileDrawer = dynamic( () => import('@/components/shared/MobileDrawer'), { ssr: false } // Client-side only ); ``` ### Conditional Rendering ```tsx // Don't render desktop components on mobile const isMobile = useMediaQuery('(max-width: 640px)'); return ( <> {isMobile ? : } ); ``` ### Font Loading ```tsx // next.config.js module.exports = { optimizeFonts: true, // Font subsets for faster loading experimental: { optimizeFonts: ['latin', 'latin-ext'], }, }; ``` ### CSS Optimization ```css /* Critical CSS inline in */ /* Non-critical CSS lazy-loaded */ /* Reduce animations on mobile for performance */ @media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } } /* Disable hover effects on touch devices */ @media (hover: none) { .hover-effect:hover { /* No hover effect */ } } ``` --- ## Testing Guidelines ### Responsive Testing Checklist - [ ] Test on real devices (not just browser DevTools) - [ ] iOS Safari (iPhone 13, 14, 15) - [ ] Android Chrome (Samsung, Pixel) - [ ] Tablet: iPad Pro, Android tablet - [ ] Foldable devices (Galaxy Fold, Surface Duo) - [ ] Landscape and portrait orientations - [ ] Text zoom (up to 200%) - [ ] Touch target sizes (min 44x44px) - [ ] Keyboard navigation on tablets - [ ] Screen reader compatibility ### Breakpoint Testing Script ```typescript // utils/breakpoints.test.ts import { render } from '@testing-library/react'; import { useMediaQuery } from '@/hooks/useMediaQuery'; describe('Responsive Breakpoints', () => { const breakpoints = [320, 480, 640, 768, 1024, 1280, 1536]; breakpoints.forEach(width => { test(`Renders correctly at ${width}px`, () => { window.innerWidth = width; window.dispatchEvent(new Event('resize')); const { container } = render(); expect(container).toMatchSnapshot(); }); }); }); ``` --- ## Conclusion This responsive design guide ensures ColaFlow provides an optimal experience across all device sizes. By following mobile-first principles and adapting components appropriately, we maintain usability and performance on every screen. **Key Takeaways:** 1. Always start with mobile design 2. Use appropriate breakpoints for content, not devices 3. Simplify UI on small screens 4. Optimize performance for mobile networks 5. Test on real devices **Next Steps:** 1. Implement responsive components 2. Conduct device testing 3. Measure performance metrics 4. Gather user feedback 5. Iterate and improve **Questions:** Contact UX/UI team at ux@colaflow.com