Fiber UI LogoFiberUI

Hooks

Reusable React hooks for common patterns

A collection of type-safe, SSR-compatible React hooks organized by category.

Storage

Hooks for persisting data in browser storage:

HookDescription
useLocalStorageStateSync state with localStorage (persistent)
useSessionStorageStateSync state with sessionStorage (per-tab)
useIndexedDBStore large data in IndexedDB

Comparison

FeatureuseLocalStorageStateuseSessionStorageStateuseIndexedDB
Storage Limit~5MB per origin~5MB per originGBs (quota-based)
Data TypesJSON serializableJSON serializableAny (objects, blobs)
PersistenceForeverUntil tab closesForever
Cross-tabSyncsIsolatedShared
API StyleSynchronousSynchronousAsynchronous
Best ForPreferences, tokensForms, wizardsLarge data, offline

Device

Hooks for accessing device capabilities and hardware:

HookDescription
useBatteryAccess real-time battery information
useMediaDevicesList cameras, microphones, and speakers
useGeolocationGet device location using GPS or Wi-Fi

Utility

General-purpose utility hooks:

HookDescription
useIsMountedDetect if component is mounted (SSR safe)
useClipboardCopy and read text from the clipboard
useDebouncedStateDebounce state values
useDebouncedCallbackDebounce callback functions
useThrottledStateThrottle state values
useThrottledCallbackThrottle callback functions