2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Hooks

useDebounce

Updated: February 22, 2026
View on GitHub
The useDebounce hook delays updating a value until after a specified delay period has passed without changes. This is useful for optimizing performance in scenarios like search inputs, API calls, or expensive computations. Used in components: Input, Textarea (for character count updates), EmojiPicker (for search filtering)
  • Delays value updates until user stops typing
  • Prevents excessive API calls or computations
  • Simple and lightweight implementation
  • Works with any value type
Debounce a search input to avoid excessive API calls: Optimize API requests by debouncing user input: Debounce expensive calculations:
Prop
Type
Default
value
any
delay
number
Returns the debounced value that updates only after the specified delay period has passed without changes.
  • Choose appropriate delay: 300-500ms for search, 100-200ms for UI feedback
  • Combine with useMemo: Debounce input, then memoize expensive computations
  • Cancel pending requests: Clean up API calls when component unmounts
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club