persistent-filter

Persist UI filter state across URL search params and sessionStorage.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Swear4/agent_rules --skill persistent-filter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: persistent-filter
Source: https://github.com/Swear4/agent_rules/tree/main/agent-universal/skills/persistent-filter
Command: npx skills add https://github.com/Swear4/agent_rules --skill persistent-filter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Automatically persisting UI filter state across the URL and sessionStorage eliminates manual re-entry and keeps filters consistent when users navigate, share links, or refresh pages.

Core Features & Use Cases

  • Persist chosen filter values to URL search params for shareable links and browser navigation.
  • Mirror state in sessionStorage to maintain per-tab memory while avoiding stale data across tabs.
  • Support common UI controls (dropdowns, toggles, search fields, date pickers, status selectors) with a single reusable hook.

Quick Start

Implement a usePersistentFilter hook and replace your filter state with it so every filter persists in the URL and sessionStorage.

Frequently Asked Questions about persistent-filter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I persist UI filter state in the URL and sessionStorage using React?

To persist UI filter state in React, implement a reusable usePersistentFilter hook that syncs dropdowns and search inputs to URL search params and sessionStorage. This ensures filter consistency across browser navigation, page refreshes, and shared links.

Why do my dashboard filters reset when users navigate or refresh the page?

Dashboard filters reset on refresh because the UI state is not synced to the URL or sessionStorage. By mirroring filter values to URL search params and sessionStorage, per-tab memory is maintained and users avoid manual re-entry when navigating back.

Does this persistent filter hook work with date pickers and status selectors?

Yes, the persistent filter hook works with date pickers and status selectors. It is designed to support common UI controls including dropdowns, toggles, and search fields across dashboards and data views using a single reusable hook implementation.

What is the best way to sync URL search params with React hooks for shareable links?

The best way to sync URL search params with React hooks is using a usePersistentFilter hook that automatically updates the URL during filter changes. This enables shareable links and handles default-value cleanup to prevent stale data across tabs.

How do I handle default-value cleanup when persisting frontend filters to the URL?

Handle default-value cleanup in URL filter persistence by using a usePersistentFilter hook that removes default parameters from the URL search params. This prevents cluttered URLs and ensures sessionStorage does not retain stale data across different tabs.