Skip to content

useMediaQuery

The useMediaQuery hook allows you to listen to CSS media queries and reactively update your components based on viewport changes. Ideal for responsive design and dynamic layouts.

resize for test

sm (425px): false

md (768px): false

custom (800px): false

PropTypeDefaultDescription
featurestringThe CSS media feature to match, such as "max-width", "min-width", "orientation", etc.
valuestringThe threshold value for the media feature, e.g., "768px", "sm", "md". Supports standard breakpoints and custom values.
optionsobject{}Optional configuration for the media query listener (e.g., initial value).