Mark the Current Page in Breadcrumbs

Write the code, see it run, pass the checks.

The problem

  • easy
  • Code

Show visitors where they are with breadcrumbs. The component gets a trail prop: a list of { label, href } objects from the home page down to the current page (the preview shows Home, Learn, Software and React in practice). Render a nav element named "Breadcrumb" (aria-label) holding an ordered list with one list item per crumb, each with a link to its href showing its label. The last crumb is the page you're on: give its link aria-current="page", and don't give any other link aria-current="page". If you add separators between crumbs, keep them away from screen readers (aria-hidden="true", or draw them with CSS).

Your code must pass

  • A navigation landmark named "Breadcrumb" holds an ordered list of the crumbs
  • Each crumb links to its page
  • Only the last crumb has aria-current="page"
  • It follows the trail it's given