Frontend School

Build a Multi-step Webhook Configuration Form

Machine Coding
medium

Build a Multi-step Webhook Configuration Form

Medium
multi-step form
React
Frontend
State Management
Validation

Overview

Postman allows users to automate workflows by configuring webhooks that trigger on various events. This problem focuses on building a user-friendly multi-step form for creating and configuring a new webhook. A guided, intuitive experience is crucial for users setting up complex integrations, ensuring all necessary details are captured accurately across different configuration stages.

What you need to do / Task

Your task is to implement a 3-step multi-step form for configuring a webhook. The form should:

  1. Step 1: Basic Information

    • Collect Webhook Name (text, required)
    • Collect Description (textarea, optional)
    • Collect Status (checkbox, active by default)
  2. Step 2: Endpoint Configuration

    • Collect Endpoint URL (text/url, required)
    • Collect HTTP Method (dropdown: POST, GET, PUT, DELETE - POST by default)
    • Collect Request Body (textarea, JSON/text)
    • Note: Headers are pre-filled and read-only for this problem's scope.
  3. Step 3: Review & Confirm

    • Display a summary of all data collected from Step 1 and Step 2.
    • Include a 'Submit Webhook' button.
  4. Navigation & State Management

    • Implement 'Next' and 'Previous' buttons to navigate between steps.
    • Persist form data across steps as the user navigates.
  5. Client-side Validation

    • Implement basic validation for required fields before allowing the user to advance to the next step.
    • Display appropriate error messages for validation failures.
  6. Submission

    • On the final 'Review' step, clicking 'Submit Webhook' should log the entire formData object to the console and display an alert confirming submission (no actual API call needed).

UI/UX expectations

  • The form should clearly indicate the current step (e.g., using step dots).
  • 'Next' button should be available to advance, 'Previous' button to go back.
  • The 'Submit Webhook' button should only appear on the final step.
  • Error messages for validation failures should be clearly visible next to the relevant input fields.
  • Basic styling is provided in styles.css to give a reasonable appearance.

Acceptance criteria

  • The form renders with Step 1 active upon initial load.
  • 'Next' button correctly advances to the subsequent step, preserving all entered data.
  • 'Previous' button correctly navigates back to the preceding step, preserving all entered data.
  • Attempting to advance with empty required fields (Webhook Name, Endpoint URL) displays an error message and prevents step progression.
  • Step 3 (Review & Confirm) accurately displays all collected form data.
  • Clicking 'Submit Webhook' on Step 3 logs the complete form data to the console and triggers an alert.

Constraints

Constraints & assumptions

  • You should use React functional components and hooks.
  • No external UI component libraries (e.g., Material UI, Ant Design) are allowed; build components using native HTML elements and CSS.
  • Form data persistence is only required in-memory for the component's lifecycle; no browser storage (e.g., localStorage) or backend integration is needed.
  • Focus on the core functionality; advanced features like complex regex validation, debounce, or accessibility optimizations are out of scope.

Out of scope

  • Backend API integration for form submission.
  • Complex, schema-based validation.
  • Dynamic addition/removal of headers or other complex nested data structures.
  • Full accessibility (ARIA attributes, keyboard navigation beyond default browser behavior).
  • Responsive design for different screen sizes.
  • Client-side routing (e.g., using react-router-dom).

What interviewers evaluate

  • Correct implementation of a multi-step form flow and navigation logic.
  • Effective state management for form data across steps.
  • Robust client-side validation for required fields.
  • Clean, readable, and well-structured React code.
  • Appropriate use of React hooks and component composition.

Loading editor...