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

useResponsiveClasses

Updated: July 27, 2026
View on GitHub
The useResponsiveClasses hook is an internal utility used by Flex and Grid components to manage responsive CSS classes based on breakpoints. It dynamically applies and removes classes as the viewport size changes. Used in components: Flex, Grid
  • Automatic responsive class management
  • Breakpoint-based class switching
  • Optimized for performance
  • Used internally by Flex and Grid
This hook is used internally by the Flex and Grid components and is not typically used directly in application code. The hook:
  • Monitors window resize events
  • Compares current width against breakpoints
  • Applies appropriate CSS classes for the current breakpoint
  • Removes classes from other breakpoints
The hook manages responsive classes for:
  • position - static, relative, absolute, fixed, sticky
  • direction - row, column, row-reverse, column-reverse
  • horizontal - justify-start, justify-end, justify-center, etc.
  • vertical - align-start, align-end, align-center, etc.
  • overflow - visible, hidden, scroll, auto
  • overflowX - x-axis overflow
  • overflowY - y-axis overflow
  • columns - grid column count (1-12)
  • flex - flex values (1-12)
  • wrap - wrap, nowrap, wrap-reverse
  • hide / show - responsive visibility
  • top, right, bottom, left - position offsets
  • align - text alignment
  • scrollbar - scrollbar visibility
  • pointerEvents - pointer event handling
  • opacity - opacity levels
  • zIndex - z-index levels
  • transition - transition presets
The hook works with per-component breakpoint types defined via BreakpointProps<Source, Keys>: The hook is optimized with:
  • Debounced resize handling
  • Efficient class manipulation
  • Minimal re-renders
  • Cleanup on unmount
Used by:
  • Flex
  • Grid
When a Flex component has responsive props: This is an internal hook. For responsive layouts, use the Flex and Grid components directly with responsive props rather than using this hook. See Responsive Breakpoints for the full API.
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club