Browser History API Package
The Browser History API package provides comprehensive control over browser navigation history. This package exposes actions for navigating backwards and forwards through history, manipulating history entries, and formulas to access current history state. Perfect for building dynamic single-page applications with custom navigation flows and maintaining proper browser history management.
Demo
History API Showcase
This component demonstrates how to use global formulas and actions to interact with the browser's History API.
Current History State
History Length
Interactive Controls
Actions
Back
Navigate backwards in the browser history. Equivalent to clicking the browser's back button or calling window.history.back().
Forward
Navigate forwards in the browser history. Equivalent to clicking the browser's forward button or calling window.history.forward().
Go
Navigate to a specific position in the history stack. Accepts positive or negative integers to move forward or backward by that many entries.
Push State
Add a new entry to the browser history with custom state data and URL, without triggering a page reload.
Replace State
Modify the current history entry's state data and URL without adding a new entry to the history stack.
Formulas
History Length
Returns the number of entries in the browser history stack, including the current page.
Current State
Returns the state object associated with the current history entry.