@raycast/api and @raycast/utils. All hooks are fully compatible with the Raycast API specification.
Navigation
useNavigation
useNavigation
Navigate between views in your extension
useNavigation hook provides methods to navigate between views.
(component: React.ReactElement) => void
Push a new view onto the navigation stack
() => void
Pop the current view from the navigation stack
Data Fetching
useFetch
useFetch
Fetch data from HTTP APIs with automatic state management
usePromise
usePromise
Execute async functions with state management
useCachedPromise
useCachedPromise
Execute async functions with caching and pagination
usePromise but with built-in caching and pagination support.
Type Signature:
useCachedState
useCachedState
Persist state to local storage automatically
Form Management
useForm
useForm
Manage form state with validation
Shell & SQL
useExec
useExec
Execute shell commands with state tracking
useSQL
useSQL
Query SQLite databases with state tracking
AI & Streaming
useAI
useAI
Execute AI prompts with streaming support
useStreamJSON
useStreamJSON
Fetch and stream JSON data with client-side pagination
Utilities
useLocalStorage
useLocalStorage
React hook for LocalStorage with change notifications
useFrecencySorting
useFrecencySorting
Sort items by frequency and recency