```
## Navigation Patterns
### Mobile Menu Pattern
```tsx
import { useState } from 'react';
import { List, X } from '@phosphor-icons/react';
export function MobileNav() {
const [isOpen, setIsOpen] = useState(false);
return (
<>
{/* Mobile menu button */}
{/* Mobile menu overlay */}
{isOpen && (
)}
{/* Desktop navigation */}
>
);
}
```
### Sticky Navigation
```tsx
```
## Responsive Forms
### Form Layout Pattern
```tsx
```
## Responsive Content Hiding
### Show/Hide Based on Screen Size
```tsx
```
## Testing Responsive Designs
### Browser DevTools
1. Open Chrome/Firefox DevTools (F12)
2. Toggle device toolbar (Ctrl+Shift+M)
3. Test common breakpoints:
- iPhone SE (375px)
- iPhone 12 Pro (390px)
- iPad (768px)
- iPad Pro (1024px)
- Desktop (1280px+)
### Real Device Testing
**Essential devices to test:**
- Small phone (iPhone SE, Android small)
- Large phone (iPhone Pro Max, Android large)
- Tablet (iPad, Android tablet)
- Desktop (various resolutions)
### Playwright Testing
```typescript
// Use playwright MCP to test responsive breakpoints
await page.setViewportSize({ width: 375, height: 667 }); // iPhone SE
await page.screenshot({ path: 'mobile.png' });
await page.setViewportSize({ width: 768, height: 1024 }); // iPad
await page.screenshot({ path: 'tablet.png' });
await page.setViewportSize({ width: 1920, height: 1080 }); // Desktop
await page.screenshot({ path: 'desktop.png' });
```
## Common Responsive Patterns
### Card Grid
```tsx
{items.map(item => (
{item.title}
{item.description}
))}
```
### Hero Section
```tsx
Your Headline Here
Supporting description that works across all screen sizes.
```
## Accessibility Considerations
### Focus Management on Mobile
```tsx
```
### Skip Links
```tsx
Skip to main content
```
## Best Practices Summary
✅ **Do:**
- Start with mobile design first
- Use relative units (rem, em, %) for flexibility
- Test on real devices, not just emulators
- Ensure touch targets are at least 44x44px
- Use semantic HTML for better accessibility
- Implement lazy loading for images and videos
- Optimize assets for mobile networks
- Use CSS Grid and Flexbox for flexible layouts
- Provide adequate spacing between interactive elements
❌ **Don't:**
- Design for desktop first and scale down
- Use fixed pixel widths for layout containers
- Rely solely on browser DevTools for testing
- Make touch targets too small
- Forget keyboard navigation
- Load all images eagerly
- Use large unoptimized images on mobile
- Use complex nested tables for layout
- Place important actions in hard-to-reach areas