Component: Back Button

Purpose: Provides a button for navigating back, with intelligent handling of different scenarios including redirect URLs and browser history.

The Back Button component uses the following logic to determine its behaviour when clicked:

  1. If there is a "redirect" parameter in the current URL's search params (for example: ), then navigate to the URL while preserving other URL parameters (except "redirect").

  2. If no "redirect" URL is present but there's a previous page in the browser history, then navigate back to the previous page.

  3. If there's no "redirect" URL and no previous page in history, then navigate to the origin of the current page (window.location.origin).

Props

Prop Label

Type

Default Value

Info

buttonLabel

Button Label

string

Back

Last updated

Was this helpful?