Hooks & Utilities
v1.0.0Added in 1.0.0
useState that survives reloads in localStorage, sessionStorage or a cookie, syncs across components and tabs, and hydrates cleanly.
Switch the listing view in either card: the other card follows at once because both read the same key. Type a message: it is saved as you type. Press Reload to remount the demo and watch every value come back, or Delete draft to forget the draft. Open the page in a second tab and changes in local storage follow you there.
npx wingo-ui@latest add use-persisted-statePro item: the CLI needs a Pro account. See plans

Trek city bike
$1,200

Sleeper sofa
$850

MacBook Air M2
$4,300

iPhone 13
$1,850

Trek city bike
$1,200

Sleeper sofa
$850
local: ui-lab:preferences:view, ui-lab:preferences:draft · syncTabs on