Visual reference for product builders. Learn the design patterns behind every professional interface.
Static design styles that define visual personality. Colors, textures, and treatments—from brutalist to maximalist—that establish your product's look at rest.
RAW CONCRETE—EXPOSED—NO POLISH
Clean, sparse, whitespace-heavy design with only essential elements
Modern brutalism with vibrant colors, thick borders, hard shadows, playful yet bold
Google's design language—elevation shadows, bold colors, paper-like layers
Frosted glass blur effects with translucent layers, transparency, and soft depth
Multiple translucent layers create depth
Soft embossed/debossed shadows creating tactile, pressable depth with subtle lighting
Soft 3D renders, inflated shapes, pastel colors, rounded edges
Dense layering, rich patterns, abundant ornamentation, and vibrant colors— controlled chaos with maximum visual impact
Realistic textures and physical material mimicry—leather, wood, stitching
No depth, no gradients, solid colors, simple shapes—anti-skeuomorphic
Bold gradient overlays, vibrant color meshes, neo-retro aesthetic
Single color palette, minimal variation, austere and formal
Dark backgrounds, high contrast, OLED-optimized, reduced eye strain
Bold geometric shapes, clashing colors, 80s revival, playful asymmetry
Curved forms, nature-inspired shapes, flowing layouts, soft edges
Decorative shapes as art—triangles, circles, hexagons, colorful geometric patterns
Mathematical grids, Helvetica font, asymmetric typography, objective clarity
Form follows function—primary colors only, basic shapes, no ornamentation
Aged textures, nostalgic palettes, old-school typography, vintage aesthetics
90s nostalgia, pink/purple gradients, Japanese text, surreal internet aesthetic
80s retro-futuristic—neon sunsets, perspective grids, chrome, outrun aesthetic
Futuristic 2000s—metallic, bubbly, chrome, translucent plastics, optimistic tech aesthetic
High contrast neon, dark backgrounds, sci-fi inspired, glitch effects
Retro gaming aesthetic—8-bit/16-bit, limited palette, pixel-perfect grid
Glowing signs aesthetic—bright tubes, urban nightlife, retro storefronts, electric glow
Luxury geometric patterns, 1920s glamour, symmetrical elegance, metallic accents
Blue/gray palette, conservative, hierarchical, trust-focused, enterprise-grade
Print-inspired—serif typography, column layouts, high contrast, magazine aesthetic
"Typography is the voice of the written word."
Hand-drawn elements, imperfect lines, human touch, warm and approachable
Rough textures, distressed overlays, rebellious, unpolished, raw energy
Dark cathedral—ornate details, dramatic shadows, deep purples and blacks, gold accents, luxury meets darkness
80s neon paradise—hot pink, electric cyan, purple nights, palm trees, sunset gradients, retro futurism
Free-spirited artisan—earthy tones, textures, handcrafted, organic shapes, eclectic patterns, wanderlust vibes
Scandinavian simplicity—clean lines, natural materials, white space, light wood, functional beauty, hygge warmth
Victorian industrial—brass gears, copper pipes, rivets, mechanical details, vintage machinery, retro-futurism
Pastoral romance—soft pastels, floral patterns, handmade quilts, wildflowers, cozy cottages, countryside charm
Refined restraint—premium materials, precise details, subtle elegance, expensive simplicity, Apple aesthetic, quiet luxury
Organic elegance—flowing curves, botanical motifs, nature-inspired
Opulent abundance—rich gold, jewel tones, ornate patterns, baroque details, Versace vibes, more is more
Editorial drama—stark contrast, bold typography, runway aesthetics, magazine layouts, Vogue vibes, timeless elegance
Japanese philosophy of imperfect beauty—natural textures, asymmetry, weathered surfaces, embracing age and wear
Bold brutalist layouts meet soft pastels—thick borders, heavy type, rounded corners, gentle colors
Street art—spray paint, wild style letters, tags, throws, drips
1960s retro-futurism—chrome, orbs, atomic age, space race optimism
Vintage scholarly aesthetic—library vibes, leather & wood, classical references, old books, gothic romance
2000s tech optimism—glossy buttons, aqua colors, bubbles, nature meets technology
Highlight on top, shadow below
Eco-futurism—green tech, renewable energy, nature-tech harmony
African diaspora meets sci-fi—cultural heritage, advanced technology, geometric patterns, rich symbolism
Intentional rule-breaking—chaotic typography, clashing colors, experimental, rebellious
REBEL
Revolutionary propaganda—bold geometry, red/black/white, diagonal lines, avant-garde
Psychedelic distortion—liquid chrome, warped type, iridescent gradients, surreal trippy visuals
Early internet nostalgia—table layouts, under construction GIFs, basic HTML, blue links
Modern tech illustration—flat diverse people, pastel colors, geometric shapes, friendly corporate
Print aesthetic—limited colors, grainy texture, slight misalignment, DIY zine feel
Magenta
Blue
Motion-first type—animated text, dynamic letterforms, text as primary visual element
Slide
Rotate
Scale
Interactive polish and micro-details that elevate products from functional to memorable. Strategic use of these patterns adds perceived value and differentiates in crowded markets.
Buttons attract cursor when nearby—creating gravity-like pull effect
Curved organic section breaks using SVG—replaces straight lines between sections
Navigation follows scroll—adds backdrop blur and shadow when scrolled for depth
Elements fade/slide in when entering viewport—cinematic progressive reveal effect
Card tilts toward cursor. Fake 3D depth effect. Hover effect that screams "look at me." Portfolio site staple.
Move your cursor around to see the 3D effect
Graphics follow your mouse. Circles, sparkles, gradient trails. Portfolio site staple. Pure delight.
Move your cursor here
RGB split, scan lines, distortion. Error aesthetic. Cyberpunk staple. Makes everything look hacker-y.
Border that shifts colors or moves. Animated stroke. Neon button effect. Makes CTAs impossible to ignore.
Words appear as you scroll down. Cinematic effect. Overused in agency sites. Still looks cool when done right.
Animated amorphous shapes that pulse and shift. Gradient blobs that look alive. Background decoration gold standard.
Organic movement
Text styling fundamentals that form the foundation of clear communication. Understanding these concepts enables precise control over readability and visual hierarchy.
Combining typefaces
Harmony in sizing
No breakpoints needed
Readable text requires contrast
Optimal reading width
Guide readers through content
Letter spacing fundamentals
Line-height spacing
Response patterns that make interfaces feel alive. Animations, gestures, and feedback systems that react to user input—from hover states to drag-and-drop mechanics.
Motion-based design—animated transitions, dynamic elements, movement that guides
Depth through multi-layer scrolling—background moves slower than foreground
Visual feedback on mouse-over—reveals affordances, shows interactivity
Direct manipulation—grab, move, place objects intuitively
Small, delightful moments—button animations, toggle transitions, loading states
Mobile gesture—drag down to reload content, spinner indicates loading
Endless content loading—scroll to bottom, automatically fetch more
Touch-based navigation—horizontal slides, card dismissal, reveal actions
Structural patterns for organizing content and navigation. From hierarchical trees to flat structures—these determine how users mentally model and navigate your product.
Grid of self-contained cards—each item is independent, Pinterest/Twitter feed style, scannable
Tree structure navigation—parent-child relationships, folders, nested menus, top-down flow
Central dashboard pattern—main hub connects to separate sections, always return to center
Step-by-step flow—onboarding wizards, checkout processes, multi-step forms, linear progression
Create your account
Filterable collection—search, sort, filter large datasets, table views, spreadsheet-like
Name | Category | Price |
---|---|---|
Product A | Electronics | $299 |
Product B | Clothing | $49 |
Product C | Electronics | $599 |
Product D | Home | $129 |
Minimal hierarchy—all content at same level, simple navigation, no deep nesting
Two-axis navigation—rows and columns, comparison tables, feature matrices, dual categorization
Feature 1 | Feature 2 | Feature 3 | Feature 4 | |
---|---|---|---|---|
Plan A | ✓ | ✓ | ✓ | ✓ |
Plan B | ✓ | ✓ | ✓ | ✓ |
Plan C | ✓ | ✓ | ✓ | ✓ |
Web of connections—nodes and links, Wikipedia-style, cross-references, non-linear exploration
Horizontal categorization—switch between views, same-level sections, keeps context visible
Overview section with general information.
Temporary overlays—dialogs, drawers, popups, focused tasks without leaving context
Vertical stack—expand/collapse sections, progressive disclosure, space-efficient content organization
Path trail—shows location, navigational hierarchy, "you are here" indicator, backward navigation
Expansive dropdown—multi-column panels, rich content, visual categories, complex navigation made simple
Boundless workspace—pan and zoom, spatial thinking, mind maps, whiteboards, free-form exploration
Chronological flow—events in sequence, temporal organization, history view, progress tracking
Spatial arrangements that structure content. Grids, splits, bento boxes, and dashboards—the foundational scaffolding that establishes hierarchy and visual flow.
Mosaic grid layout—tiles of varied sizes, asymmetric arrangement, modern dashboard aesthetic
Waterfall grid—Pinterest-style columns, varying heights, organic vertical flow
Dual pane layout—50/50 vertical split, side-by-side content, clear division
Full-screen landing—centered content, large headline, prominent CTA, above-the-fold impact
Side navigation—fixed nav panel, main content area, app-style interface, persistent menu
Uniform grid—equal-sized cards, consistent spacing, clean gallery layout
Widget-based layout—data panels, charts, metrics, multi-section grid, analytics interface
Classic 5-section—header, footer, left sidebar, right sidebar, central content
Editorial layout—multi-column text, large images, print-inspired typography
Layered depth—overlapping cards, elevated shadows, z-axis stacking
CLI aesthetic—command-line interface, monospace fonts, dark theme
Input controls and validation mechanisms for data collection. Text fields, dropdowns, date pickers, and validation states—designed for accuracy and efficiency.
Text entry—labels, placeholders, types (email, password), focus states
Error feedback—inline validation, real-time checks, clear error messages, prevent bad data submission
Smart suggestions—type-ahead search, filtered results, keyboard navigation, faster data entry
Document picker—drag & drop, browse button, progress indication, file type restrictions, multi-file support
Multi-select—independent choices, check/uncheck, multiple selections allowed, binary options
Single choice—mutually exclusive options, one selection only, circular buttons, grouped decisions
On/Off control—instant action, binary state, physical switch metaphor, immediate effect
Calendar selector—visual date selection, month/year navigation, prevents invalid dates, better than typing
Universal finder—magnifying glass icon, query input, instant results, clear button, the gateway to content
Select menu—expandable list, single selection, space-efficient, better for many options than radio buttons
Timing functions and animation styles that bring interfaces to life. Easing curves, springs, bounces—each creates distinct emotional responses from playful to professional.
Animation that starts slowly, accelerates in the middle, then decelerates smoothly at the end. Creates natural, comfortable motion.
Physics-based animation that mimics spring behavior with natural overshoot and settling. Creates playful, organic motion.
Instant animation with no interpolation. Element jumps from one state to another immediately. Creates emphasis and urgency.
Gradual opacity transition from invisible to visible or vice versa. Creates subtle, elegant appearances and disappearances.
Movement along a single axis from one position to another. Creates directional, purposeful transitions with clear spatial relationships.
Size transformation that grows or shrinks elements from a center point or origin. Creates emphasis and focus.
Animation with elastic rebound effect that simulates physical bounce. Creates playful, energetic motion with personality.
Smooth transformation between different shapes, sizes, or states. Creates fluid, organic transitions that show relationships.
Layered animation where elements move at different speeds to create depth. Creates immersive, dimensional scrolling experiences.
Sequential animation where multiple elements animate with progressive delays. Creates rhythm and visual flow.
Communication patterns that define brand personality. Voice is consistent identity—tone adapts to context. Reference these for copy across support, marketing, and product.
Formal, authoritative voice—expert tone, precise language, credible communication
"We appreciate your business. Our enterprise solutions are designed to optimize operational efficiency and deliver measurable results."
"Authentication failed. Please verify your credentials and attempt to access the system again."
Warm, conversational voice—approachable, welcoming, personable communication
"Hey there! We're so glad you're here. Our team is ready to help make things easy for you. Feel free to reach out anytime!"
"Oops! Something didn't work quite right. Let's try that again together—we're here to help!"
Fun, lighthearted voice—entertaining, energetic, whimsical communication
"Welcome to the party! 🎉 Ready to dive in? We've got some awesome stuff lined up that'll knock your socks off!"
"Whoopsie-daisy! Looks like something went sideways. Give it another whirl!"
Commanding, confident voice—expert knowledge, decisive tone, trustworthy delivery
"This platform delivers proven solutions backed by 20 years of industry leadership. Trust the experts."
"Access denied. Invalid credentials. Follow protocol and re-enter authorized information."
Uplifting, motivational voice—empowering, aspirational, encouraging communication
"Your journey to greatness starts here. Together, we'll unlock your full potential and achieve extraordinary results."
"Every setback is a setup for a comeback. Let's try again—you've got this!"
Unconventional, witty voice—unique personality, memorable, distinctively offbeat
"Plot twist: you just stumbled into the coolest corner of the internet. Buckle up, buttercup—things are about to get interesting."
"Well, that was awkward. The digital gremlins are at it again. Let's give this another shot!"
Excited, festive voice—joyful, enthusiastic, achievement-focused communication
"Congratulations! 🎊 You're about to achieve something amazing. Let's celebrate every win, big and small!"
"Not quite there yet, but you're so close! One more try and we'll be celebrating together!"
Understanding, compassionate voice—supportive, caring, emotionally aware delivery
"We understand this might feel overwhelming. You're not alone—we're here to support you every step of the way."
"We know how frustrating this can be. Let's work through this together—your concerns matter to us."
Time-sensitive, critical voice—immediate action required, attention-grabbing delivery
"Action required now! Your immediate attention is needed. Complete these steps within the next 24 hours."
"Critical error detected. Immediate action required. Fix this issue now to prevent data loss."
Informative, instructive voice—clear explanations, teaching-focused, accessible knowledge
"Let's learn together. This guide will walk you through each concept step-by-step, building your understanding progressively."
"This error occurs when the input format is incorrect. Here's what you need to know to fix it."
Compelling, influential voice—convincing arguments, benefit-focused, action-driven
"Imagine achieving your goals 3x faster. Our proven system has helped thousands succeed—you could be next."
"Don't let this small hiccup stop your progress. Try again now and keep moving toward success."
Relaxed, informal voice—laid-back, conversational, easy-going communication
"Hey! Good to see you. Just grab what you need and let us know if you have any questions. No pressure!"
"Hmm, that didn't work. No worries though—just give it another shot."
System communication patterns that keep users informed. Toasts, loading states, errors, and confirmations—the signals that explain what's happening in your product.
Temporary notification—auto-dismiss, non-blocking feedback
Activity indicator—rotating circle, indeterminate progress
Content placeholder—shimmer animation, better perceived performance
Visual percentage indicator filling left-to-right for determinate tasks
Zero data screen—explain why empty, guidance, clear action
Your inbox is empty. Start a conversation with your team to begin messaging.
Try different keywords
No tasks remaining
Full-width system message bar for important dismissible notifications
Destructive action guard preventing accidents with clear Yes/No choice
Notification count—small pill with number, unread indicator
Failure feedback—explain what happened, provide recovery
Unable to reach server. Check connection.
Not found
Bad input
Too slow
Positive confirmation—green checkmark, celebratory language
Order #12345 confirmed. Check email.
Security patterns that protect your application and users. Authentication, authorization, data protection, and threat prevention—the foundations of secure software.
Third-party login—secure delegation
JSON Web Tokens—stateless authentication
Require 2 forms of proof to log in
Architecture patterns for scalable systems. Microservices, databases, caching, communication—the building blocks of robust infrastructure.
Independent services working together
Distribute traffic across servers
Store frequently used data in fast memory
Standard way apps talk to servers
Tasks wait in line
Add more servers
Files from nearest location
Split data across servers
Limit requests per user
Real-time two-way updates
Prompt engineering patterns for better AI interactions. Techniques to improve accuracy, control output, and communicate effectively with language models.
Ask AI to show its work
Show AI examples first
Randomness control—creativity vs consistency
Detailed output—comprehensive explanations
Define AI personality and rules
Give AI your docs to answer from
Break big tasks into steps
Battle-tested implementation prompts for the hardest UX problems. These are the "$10k features" every app needs—shopping carts, real-time collaboration, infinite feeds. No visuals needed, just comprehensive prompts designed to make AI think harder.
Guest checkout + local storage + magic link auth + cart migration
E-commerce sites, marketplace apps, SaaS products with paid features. Handles both logged-out browsing and seamless account creation at checkout.
Build shopping cart system with these requirements:
Guest Experience: Store cart in localStorage with unique session ID. Persist for 30 days. Handle multiple tabs syncing via storage events. Show item count badge in header.
Cart Operations: Add/remove items, update quantities, apply promo codes, calculate tax and shipping in real-time. Optimistic UI updates with rollback on errors.
Checkout Flow: Offer guest checkout (email + shipping) OR account creation. For new accounts, use magic link authentication (email with 6-digit code, 15-minute expiration). On successful auth, migrate localStorage cart to database and associate with user account.
Returning Users: On login, check for localStorage cart. If exists, merge with server cart (keep higher quantity for duplicates). Show confirmation modal before merge.
Edge Cases: Handle out-of-stock during checkout, price changes since cart addition, expired promo codes, concurrent cart modifications, network failures with retry logic.
Tech Stack: Next.js App Router, React Server Components for cart display, Server Actions for mutations, Prisma + PostgreSQL for database, Redis for session management, Resend for magic link emails.
Twitter/Instagram style + optimistic updates + skeleton loading
Social feeds, news sites, content discovery apps, activity streams. Optimized for endless scrolling with real-time updates and instant interactions.
Build infinite feed with these requirements:
Pagination: Load 20 items initially, fetch next 20 when user reaches 80% scroll depth. Use cursor-based pagination (last item timestamp) not offset-based. Implement intersection observer for scroll detection, not scroll event listeners.
Loading States: Show skeleton screens during initial load. Display "loading more" spinner at bottom during pagination. Prevent duplicate fetches with request deduplication.
Optimistic Updates: Like/unlike, bookmark, repost actions update UI immediately before server confirmation. Show subtle loading indicator on item during mutation. Roll back on error with toast notification.
Real-time: Use WebSocket or Server-Sent Events to receive new items. Show "5 new posts" banner at top instead of auto-injecting (prevents scroll jumping). Click banner to smoothly scroll to top and insert new items.
Performance: Virtualize list if >100 items (use react-window). Lazy load images with blur placeholder. Cache feed data in React Query with 5-minute stale time. Prefetch next page when user reaches 50% scroll.
Empty States: Show onboarding if feed is empty. Display "You're all caught up!" at end with suggestions to follow more accounts.
Tech Stack: React, TanStack Query (React Query) for data fetching, Intersection Observer API, react-window for virtualization, Supabase Realtime or Pusher for live updates.
Google Docs style cursors + presence + conflict resolution
Collaborative editors, design tools, project management apps, whiteboards. Enables multiple users to edit same document simultaneously without conflicts.
Build real-time collaboration with these requirements:
Presence Awareness: Show avatar bubbles of active users (max 5 visible, +N for overflow). Display colored cursor with username label tracking remote users' positions. Show "User X is typing..." indicator. Auto-remove user after 30 seconds of inactivity.
Conflict Resolution: Use Operational Transformation (OT) or CRDT (Conflict-free Replicated Data Type) for text editing. Implement last-write-wins for form fields with visual indicator showing who made last change and when. Lock editing on specific sections when user is actively typing (release after 3 seconds of no input).
Change Broadcasting: Send changes via WebSocket with 50ms debounce. Include operation type (insert/delete/update), position, content, user ID, and timestamp. Handle offline mode by queuing changes and syncing on reconnect.
Version History: Create snapshot every 5 minutes or 100 operations. Store diffs not full copies. Allow restore to any point with visual diff preview. Show timeline slider with user avatars marking who made changes.
Permissions: Support view-only, comment-only, and edit modes. Show permission badge next to user avatars. Allow document owner to change permissions in real-time (immediately revoke access).
Network Resilience: Show connection status indicator. Buffer changes during disconnect. On reconnect, replay buffered operations with conflict resolution. Show "Syncing..." state with retry count.
Tech Stack: Yjs or Automerge for CRDT, Liveblocks or Partykit for real-time infrastructure, TipTap or ProseMirror for rich text editing, WebSocket for transport layer, Redis for presence tracking.
Progress tracking + conditional branching + exit recovery
New user onboarding, account setup wizards, product configuration flows. Guides users through complex setup with data persistence across steps.
Build multi-step onboarding with these requirements:
Step Management: Create wizard with 4-7 steps. Show progress bar with step titles. Support back/next navigation. Validate current step before allowing progression. Store completed step numbers in state.
Data Persistence: Save form data to localStorage after each step. Persist for 7 days. On page reload or return visit, restore user to last completed step with all previous data. Show "Resume where you left off" banner if incomplete onboarding detected.
Conditional Branching: Show/hide steps based on previous answers. Example: If user selects "Business" account, show company details step. If "Personal", skip to preferences. Update progress bar dynamically when steps are added/removed.
Exit Intent: Detect when user tries to leave (beforeunload event). Show modal: "Save progress and finish later?" with options to Continue or Exit. Send reminder email after 24 hours if onboarding incomplete.
Validation: Real-time validation per field with debouncing. Show field-level errors immediately. Block progression if current step has errors. Summarize all errors at top if user tries to skip.
Final Submission: On last step, show summary of all answers with Edit buttons. Submit all data at once with loading state. On success, clear localStorage and redirect to dashboard. On error, keep data and show specific error message.
Tech Stack: React Hook Form for validation, Zustand or Context for step state, localStorage for persistence, Framer Motion for step transitions, Zod for schema validation.
Faceted search + URL sync + debouncing + recent searches
Product catalogs, job boards, real estate listings, any searchable database. Enables users to narrow down large datasets with multiple filter criteria.
Build search with filters with these requirements:
Search Input: Debounce search queries by 300ms. Show loading indicator in search box during fetch. Display result count: "Showing 43 of 1,203 results". Highlight search terms in results.
Filter System: Support multiple filter types: checkboxes (categories), range sliders (price), dropdowns (location), date pickers. Show active filter count badge. Display active filters as removable chips above results. "Clear all" button when multiple filters active.
URL Synchronization: Encode all filters and search query in URL params. Update URL without page reload (pushState). Parse URL on load to restore exact search state. Enable back/forward browser navigation through search history. Make URLs shareable—clicking link shows identical results.
Faceted Counts: Show result counts next to each filter option: "Electronics (234)". Update counts dynamically when other filters applied. Disable options with 0 results (gray out). Recalculate counts with each filter change.
Recent Searches: Store last 5 searches in localStorage. Show dropdown of recent searches below input on focus. Include search query and filter state. Allow clicking to restore exact search. Clear individual history items or all at once.
Performance: Implement server-side filtering with indexed database queries. Paginate results (20 per page). Cache filter options that rarely change. Use React Query with staleTime for repeated searches.
Tech Stack: Next.js with useSearchParams hook, React Query for search caching, Algolia or Typesense for advanced search, PostgreSQL with GIN indexes for full-text, Zustand for filter state.
Drag-drop + progress + retry + preview + cloud storage
Document uploads, profile pictures, content management, attachments. Handles large files with progress tracking, validation, and cloud storage integration.
Build file upload flow with these requirements:
Drop Zone: Create drag-and-drop area with hover state. Support click to browse files. Accept multiple files simultaneously. Show file type icons and names immediately. Validate file types and sizes before upload (reject if invalid).
Upload Progress: Show individual progress bar for each file with percentage. Display upload speed (MB/s) and time remaining. Support pausing and resuming uploads. Show all files uploading in a queue (process 3 at a time). Thumbnail preview for images during upload.
Cloud Storage: Use presigned URLs for direct browser-to-S3 uploads (skip your server). Generate unique filenames with UUID prefix. Store metadata in database: original filename, size, MIME type, upload timestamp, user ID. Set appropriate CORS and bucket policies.
Error Handling: Retry failed uploads automatically (3 attempts with exponential backoff). Show specific error messages: "File too large (max 50MB)" or "Invalid format (PDF only)". Allow manual retry with button. Don't lose progress on network disconnect.
Preview Generation: Generate thumbnails server-side for images using Sharp or Cloudinary. Extract first page for PDFs. Show loading skeleton while generating. Store preview URLs in database. Lazy load previews in galleries.
File Management: Allow deleting uploaded files (remove from storage + database). Download original file button. Copy shareable link to clipboard. Show file metadata: size, upload date, dimensions for images.
Tech Stack: AWS S3 or Vercel Blob for storage, Next.js API routes for signed URLs, react-dropzone for drag-drop, Sharp for image processing, Uppy or Filepond as alternative full solutions.
Toast queue + real-time + read/unread + grouping
Activity feeds, alerts, system messages, user interactions. Shows real-time notifications without disrupting user flow, with persistence across sessions.
Build notification system with these requirements:
Toast Queue: Display toasts in bottom-right corner stacked vertically (max 3 visible). Auto-dismiss after 5 seconds (error toasts stay until dismissed). Support success, error, warning, info types with color coding. Swipe to dismiss on mobile. Show newest on top, push older down.
Notification Center: Bell icon in header with unread count badge. Dropdown panel showing last 20 notifications. Group similar notifications: "John and 5 others liked your post". Show timestamps: "2 minutes ago" vs "Mar 15". Infinite scroll for older notifications.
Real-time Delivery: Use WebSocket or Server-Sent Events for instant delivery. Show toast for high-priority notifications (mentions, DMs). Update notification center badge count without toast for low-priority (likes, follows). Batch notifications: if 5 likes in 30 seconds, group into one.
Read/Unread State: Mark as read when notification clicked or when notification center opened. Bold unread notifications. Show blue dot indicator for unread. "Mark all as read" button. Track read status per user in database.
Notification Types: Support multiple types: likes, comments, mentions, follows, system alerts, marketing messages. Each type has icon, color, and action (navigate to post/profile). Allow filtering by type in notification center. User preferences for which types to receive.
Persistence: Store notifications in database with: type, content, timestamp, read status, user ID, reference ID (post/comment ID). Fetch last 30 days on load. Paginate older history. Delete read notifications after 90 days automatically.
Tech Stack: Sonner or react-hot-toast for toasts, Pusher or Supabase Realtime for WebSocket, PostgreSQL for storage, React Query for fetching, Zustand for unread count state.
Stripe integration + error handling + webhooks + receipts
Subscription billing, one-time purchases, donations, invoicing. Secure payment processing with proper error handling and receipt generation.
Build payment flow with these requirements:
Checkout Flow: Embed Stripe Payment Element (handles cards, Apple Pay, Google Pay). Show order summary with line items and total. Validate billing address if required. Disable submit button during processing. Show loading spinner on button: "Processing..."
Payment Intent: Create PaymentIntent on server with amount and currency. Return clientSecret to frontend. Confirm payment with Stripe.js. Handle 3D Secure authentication modal (redirect user if needed). Poll payment status after redirect return.
Error Handling: Show specific error messages: "Card declined - insufficient funds" or "Invalid CVC". Allow retry without recreating PaymentIntent. Handle network failures gracefully (don't double-charge). Timeout after 60 seconds with clear message. Log all errors to monitoring service.
Webhook Processing: Listen for payment_intent.succeeded event. Verify webhook signature with Stripe. Use idempotency keys to prevent duplicate processing. Update order status in database atomically. Send confirmation email only after webhook confirms payment. Handle failed webhooks with manual reconciliation.
Receipt Generation: Create PDF receipt with: company logo, invoice number, line items, subtotal, tax, total, payment method (last 4 digits). Store in S3 with secure URL. Email receipt immediately after webhook confirmation. Allow downloading from order history. Include refund policy and support email.
Subscription Support: For recurring billing, create Stripe Customer and Subscription. Handle trial periods, proration, plan changes. Show next billing date and amount. Allow canceling subscription (cancel at period end). Send reminder email 3 days before renewal.
Tech Stack: Stripe SDK (backend + frontend), Next.js API routes for server-side operations, React for payment form, PDFKit or Puppeteer for receipts, Resend for emails, PostgreSQL for orders.
More patterns in development: Chat Interface, Activity Feed, Multi-tenant System, Admin Dashboard
Curated by Claude Code
Deployed by John Hashem, product engineer
Use these patterns with Claude Code Starter to build AI-powered projects