Skip to main content
Frontend EngineeringIntermediateFree to access

React Learning Dashboard with Search & Status

Build a React dashboard that filters course cards and handles loading, empty and error states before connecting a real API.

Download free Markdown guideNo email, account or payment required · .md text format

What you will build

Practice components, state, accessible filtering and progressively stronger data-state management.

Before you begin

  • Node.js and npm installed
  • React component/props basics and JavaScript array methods

Local setup instructions

  1. Create a React + Vite project using npm create vite@latest, select the React template.
  2. Replace App.jsx with the starter component and start the development server.
  3. Build the UI using local sample records first; the next milestone is API integration.

Starter code

App.jsx

This is a working starting example, not the finished project. Follow the setup above and complete each milestone to build your own solution.

import { useState } from "react";

const lessons = [
  { id: 1, title: "HTML Foundations", status: "Completed" },
  { id: 2, title: "React Components", status: "In progress" },
  { id: 3, title: "REST APIs", status: "Not started" },
];

export default function App() {
  const [query, setQuery] = useState("");
  const visible = lessons.filter((item) =>
    item.title.toLowerCase().includes(query.trim().toLowerCase())
  );
  return (
    <main>
      <h1>Learning dashboard</h1>
      <label htmlFor="course-search">Search lessons</label>
      <input id="course-search" value={query} onChange={(e) => setQuery(e.target.value)} />
      {visible.length === 0 ? <p>No matching lessons.</p> : (
        <ul>{visible.map((item) =>
          <li key={item.id}><strong>{item.title}</strong> — {item.status}</li>
        )}</ul>
      )}
    </main>
  );
}

Project build milestones

  1. Split a card and search form into reusable components.
  2. Filter the list without mutating source data and show a meaningful empty state.
  3. Add a mock asynchronous fetch with loading, success and failure views.
  4. Connect a suitable public or local practice API only when you can verify its response shape.
  5. Write tests for search behavior and an accessible form label.

Completion checklist

Use these checks to self-review the finished project.

  • Typing a query filters titles case-insensitively.
  • An unmatched query displays an empty-state explanation.
  • Loading and API error states do not leave a blank screen.
  • Cards have stable React keys and input has an associated label.

Optional challenges

  • Add a course progress chart based on completed lesson counts.
  • Write an integration test for a failed API response and retry flow.