🎨 Unit 09 β€’ UI/UX Design Masterclass

User Interface Design Patterns & Components

Comprehensive production guide to modern digital UI components and design patterns: buttons, input fields, forms, cards, dialog boxes, navigation bars, sidebars, tabs, dropdowns, checkboxes, radio buttons, toggles, progress indicators, error messages, empty states, loading screens, onboarding flows, and multi-platform Web & Mobile UI paradigms.

πŸ”˜ Controls: Buttons, Toggles, Checkboxes & Radios
πŸ“ Data Input: Forms, Fields, Validation & Dropdowns
🧭 Wayfinding: Navbars, Sidebars, Tabs & Modals
⚑ Feedback: Skeletons, Empty States & Onboarding
01

Designing Interactive Buttons

Buttons are the primary interactive triggers for human-computer action. Effective button design establishes unmistakable affordance, communicates visual hierarchy, and provides deterministic feedback for every physical or virtual state.

Primary CTA (High Emphasis)

Reserved strictly for the single most important action on a screen (e.g., "Complete Purchase", "Create Account"). Strong solid background color with high contrast.

Secondary (Medium Emphasis)

Supports alternative actions without competing with the primary CTA (e.g., "Save Draft", "Back"). Uses an outlined border or light tinted background fill.

Tertiary / Ghost (Low Emphasis)

Used for subtle, low-priority actions (e.g., "Cancel", "Learn More"). Has no background or border at rest; appears as stylized text that responds on hover.

Button Type Best Use Case Optical Styling Accessibility Consideration
Primary Main flow completion (Submit, Buy, Confirm) Solid brand fill, white text, 8px corner radius Min 4.5:1 text-to-bg contrast ratio
Destructive Irreversible actions (Delete, Terminate) Red-600 fill or red border/text Requires confirmation modal or double-step friction
Icon-Only Toolbar shortcuts, bookmarking, close [X] Square/circular 40Γ—40px bound, centered glyph Mandatory aria-label for screen readers
Split Button Default action + dropdown list of variations Left action segment + right caret divider Both segments must be independently focusable via Tab
πŸ“ Ergonomics: Minimum Touch Target Dimensions

According to Apple Human Interface Guidelines (HIG) and Google Material Design 3, all interactive buttons must provide a minimum bounding target of 44Γ—44 pt (iOS) or 48Γ—48 dp (Android) to prevent mis-taps caused by the human finger pad.

02

Input Fields & High-Conversion Form Architecture

Form fields are the highest-friction touchpoints in digital software. Designing user-friendly inputs requires eliminating ambiguity through persistent labels, helpful constraints, and immediate contextual feedback.

Anatomy of a Production Input Field
  • Persistent Top Label: Never rely on placeholder text alone! Placeholders disappear once typing starts, eroding working memory.
  • Input Container: Minimum 44px height, 1px border with neutral gray, 8px padding.
  • Helper Text: Explains formatting requirements (e.g., "Must be at least 8 characters with 1 number") before the user makes an error.
  • Visual Affordance Icons: Leading icons (e.g., search glass, currency symbol) and trailing icons (e.g., password show/hide eye toggle, clear text [X]).
Forms: Layout & Psychology Principles
  • Single-Column Layouts: Eye-tracking research confirms single-column forms are completed 30% faster than multi-column forms because they maintain a direct, vertical downward scanning path.
  • Inline Validation: Validate fields upon losing focus (onBlur), not while the user is actively typing (premature error) or solely upon form submit.
  • Smart Defaults & Autocomplete: Support browser autofill (autocomplete="email"), input masking for phone numbers, and location auto-detect.
accessible-form-input.html
<!-- Production Accessible Form Field Structure -->
<div class="form-group">
  <label for="user-email" class="form-label">
    Work Email Address <span class="required" aria-hidden="true">*</span>
  </label>
  
  <div class="input-wrapper">
    <span class="leading-icon" aria-hidden="true">βœ‰οΈ</span>
    <input 
      type="email" 
      id="user-email" 
      name="email"
      placeholder="alex@company.com" 
      autocomplete="email"
      aria-describedby="email-helper email-error"
      aria-invalid="false"
      class="form-input" 
    />
  </div>

  <p id="email-helper" class="helper-text">We will send your verification token here.</p>
  <p id="email-error" class="error-text" role="alert" style="display: none;">Please enter a valid work email.</p>
</div>
03

Cards & Dialog Boxes (Modals)

Cards: Modular Content Containers

Cards group related heterogeneous information into an easily scannable, bite-sized container.

  • Media / Thumbnail: 16:9 or 1:1 aspect ratio hero image with lazy loading.
  • Header & Metadata: Category badge, timestamp, author avatar.
  • Body Copy: Max 2–3 line clamp truncation with ellipsis to preserve grid rhythm.
  • Action Footer: Explicit CTA button or secondary menu triggers.
  • Clickable Surface: Entire card bounding box can be an interactive link with elevated hover shadow.
Dialog Boxes & Modals

Modals demand urgent user attention by interrupting the main flow and disabling the underlying page with a semi-transparent backdrop scrim.

  • When to Use: Critical decision confirmations (Delete project), focused sub-tasks (Upload media), immediate system warnings.
  • Backdrop Scrim: 50–70% black overlay (rgba(0,0,0,0.6)) with optional background blur.
  • Focus Trapping: Keyboard navigation must loop strictly within the modal; pressing Esc or clicking the scrim must dismiss it.
  • Action Alignment: Primary action placed on the far right (or stacked top on mobile).
04

Wayfinding: Navigation Bars, Sidebars & Tabs

Wayfinding UI patterns establish spatial orientation, allowing users to effortlessly answer three fundamental questions: Where am I? Where can I go? How do I get back?

Navigation Bars (Header)

Primary horizontal highway located at the top of the viewport.

  • Includes brand logo (links to home), top 4–6 core routes, search bar, and user profile avatar.
  • Sticky headers remain fixed upon scroll with elevation shadow or blur backdrop.
  • Collapses into a drawer menu on mobile viewports (< 768px).
Sidebars (Vertical Nav)

Ideal for complex web applications, admin dashboards, and SaaS software.

  • Supports deep hierarchy with nested accordion menus and category section dividers.
  • Collapsible states: Full width (240–280px) vs Mini Icon Rail (64px) for maximizing data workspace.
  • Clear vertical active indicator bar (e.g., 3px purple border on the left).
Tabs (Contextual Views)

Alternates between parallel content views within the same parent context without page reloading.

  • Active tab highlighted with underline pill or distinct contrasting background.
  • Keep tab count between 2 and 6 items to prevent visual crowding.
  • Support swipe gesture navigation on mobile devices.
05

Selection Controls: Dropdowns, Checkboxes, Radios & Toggles

Choosing the right selection control prevents user cognitive paralysis and input errors:

UI Control Selection Paradigm Options Count Effect Timing Best Use Case
Radio Buttons Mutually Exclusive (Select exactly 1) 2 to 5 options Requires form submit Shipping speed, billing frequency (Monthly vs Annual)
Checkboxes Multiple Independent (Select 0 to N) 1 to 7 options Requires form submit Terms & conditions agreement, email filter tags
Toggle / Switch Binary State (On / Off) Exactly 1 binary item Immediate execution Wi-Fi toggle, Dark Mode switch, Push notifications
Dropdown Menu Select 1 or multi-select from list > 5 options Immediate or upon submit Country selection, state selector, sorting filters
⚠️ Design Rule: Radio Button vs Toggle Switch

Never use a Toggle Switch inside a form that has an explicit "Save" or "Submit" button! Toggles signify immediate, instantaneous real-world activation (like a physical light switch). If an action requires clicking "Submit" to take effect, use Checkboxes or Radio Buttons instead.

06

System Feedback: Progress Indicators, Error Messages, Empty States & Loaders

Jakob Nielsen's first usability heuristic mandates Visibility of System Status. The interface must always keep users informed of what is happening through appropriate, timely feedback.

Progress Indicators

Communicate task advancement and reduce perceived wait times:

  • Determinate (Known duration): Linear progress bars with percentages (e.g., "78% uploaded") or multi-step checkout breadcrumbs (Step 2 of 4).
  • Indeterminate (Unknown duration): Animated circular spinners used when the system cannot calculate remaining wait time.
Error Messages: Anatomy of Recovery

A high-quality error message must never leave the user stranded:

  • What happened: Plain-language description without cryptic developer stack traces.
  • Why it occurred: Concise explanation of the cause.
  • How to fix it: Direct, actionable recovery path (e.g., "Card expired. Update billing details [Button]").
Empty States as Engagement Engines

Empty states appear when no data exists (e.g., new user dashboard, cleared inbox, empty search results). An effective empty state consists of:

  • Friendly, non-intimidating illustration or icon.
  • Clear headline: "No Projects Yet".
  • Value explanation: "Create your first design project to start collaborating."
  • Direct primary CTA button: "Create New Project +".
Loading Screens: Skeletons vs Spinners

Modern UX strongly favors Skeleton Screens over traditional spinning loaders. Skeletons present gray placeholder shapes matching the exact layout of incoming content. Research demonstrates skeleton loaders make perceived page load feel 20–30% faster by preparing user visual cognition for the incoming layout structure.

07

Onboarding Screens & Multi-Platform UI Patterns

User Onboarding Patterns
  • Welcome Carousels: 3–4 punchy slides highlighting core product value propositions with a prominent "Skip" option.
  • Progressive Onboarding: Guiding users through real tasks in the product rather than dumping tutorials upfront.
  • Coach Marks & Tooltips: Spotlight overlays highlighting critical first-step controls one at a time.
  • Empty-State Checklists: Gamified setup tasks (e.g., "3 of 5 profile steps complete").
Mobile vs Web UI Pattern Matrix
  • Mobile Patterns: Bottom navigation tab bar (3–5 icons), swipe gestures (swipe-to-delete), Pull-to-Refresh, bottom sheets for filters, sticky floating action buttons (FAB).
  • Web Patterns: Persistent top header nav, mega-dropdown menus, side rails, sticky table headers, paginated data grids, split-screen master-detail views.
1
Step 1: Welcome & Permission Primer (Mobile)
Explain why push notifications or camera access is needed before triggering the system modal.
2
Step 2: Interactive Aha Moment
Enable the user to create or customize their first artifact immediately with low cognitive friction.
3
Step 3: Populated State & Habit Loop
Transition smoothly from empty state to the active dashboard with celebratory micro-feedback.
08

Viva Voce & Engineering Interview Questions

Q1 β€’ Components What are the core differences between a Toggle Switch and a Checkbox in UI design?
A Toggle Switch represents an immediate physical state change (like turning on Wi-Fi or switching to Dark Mode) that executes instantaneously without requiring a separate "Save" or "Submit" click. A Checkbox represents selection within a form or batch action, where the selected state is staged and only committed once the user submits the form.
Q2 β€’ Form UX Why should designers avoid using placeholder text as a replacement for form input labels?
Placeholders disappear the instant a user starts typing, placing excessive burden on short-term working memory. If the user forgets what they were typing or needs to review a completed form, they cannot verify the field requirement. Furthermore, placeholders often fail WCAG color contrast standards, and many screen readers do not announce placeholders reliably as field identifiers.
Q3 β€’ Ergonomics What are the minimum touch target standards for mobile buttons according to Apple HIG and Material Design?
Apple’s Human Interface Guidelines specify a minimum touch target size of 44 Γ— 44 points, while Google’s Material Design specifies 48 Γ— 48 density-independent pixels (dp). Even if the visible graphic is smaller (such as a 20px icon), the clickable bounding padding must extend to these thresholds to accommodate human fingertip contact area and prevent mis-taps.
Q4 β€’ Perceived Performance Why are skeleton screens preferred over traditional spinning activity indicators?
Spinning loaders draw user focus directly to the wait duration, increasing anxiety and making load times feel longer. Skeleton screens mirror the structure of the incoming content (cards, text lines, avatars) with animated pulsing shapes, giving users immediate visual preview of the layout. Psychological testing confirms skeletons reduce perceived wait times by 20% to 30%.
Q5 β€’ Feedback Design What three essential elements make up a constructive, user-friendly error message?
A constructive error message must communicate: 1. What happened (plain-language description avoiding technical jargon or error codes), 2. Why it occurred (clear cause without assigning blame to the user), and 3. How to recover (a direct, actionable step or CTA button allowing the user to resolve the issue immediately).
Q6 β€’ Navigation When should an application utilize a Bottom Navigation Bar versus a Navigation Drawer on mobile?
A Bottom Navigation Bar is used for 3 to 5 top-level, equally important destinations that users switch between frequently throughout a session (placing them directly inside the ergonomic Thumb Zone). A Navigation Drawer (Hamburger Menu) is used when there are more than 5 destinations, deep multi-tiered navigation trees, or infrequently accessed secondary items (like Settings, Help, and Terms).
Q7 β€’ Accessibility What accessibility criteria are required when implementing modal dialog boxes?
Modal dialogs require: 1. Focus Trapping (keyboard Tab and Shift+Tab cycling exclusively within the modal), 2. Initial Focus placed on the first interactive element or dialog title, 3. Keyboard Dismissal via the Esc key, 4. ARIA semantics (role="dialog" and aria-modal="true" with aria-labelledby), and 5. Focus Restoration returning keyboard focus to the triggering element upon closure.
Q8 β€’ Content Strategy What role does an Empty State play in product user retention?
An empty state transforms a blank, potentially confusing screen into an active onboarding opportunity. By combining an encouraging visual, friendly copy explaining the benefit of the feature, and a prominent primary call-to-action button, it guides the first-time user toward the "Aha Moment", accelerating feature adoption and preventing user churn.