Skip to content
R

react-container-query

Container Query for React Component

by daiweiluFree

#679in UI Libraries
0In stores

Description

React Container Query is a React library for responsive components that react to the size of their container rather than the window. Its REA…

Highlights

  • useContainerQuery hook for container-based queries
  • ContainerQuery component with an initial size
  • Works with native DOM containers
  • Forwarded refs for React component containers
  • Provided under an open source license

Ratings & Reviews

No ratings yet

Be the first to rate react-container-query.

People also visit

R

react-height

Component-wrapper to determine and report children elements height

UI Libraries
Launch
R

react-resizable-box

Resizable component for React. #reactjs

UI Libraries
Launch
R

react-resize-aware

A React hook that makes it possible to listen to element resize events

UI Libraries
Launch
R

responsive-patterns

Responsive design with Container Queries, fluid typography, cqi/cqb units

AI Skills
Get
R

react-on-screen

A wrapper component to track if your react component is visible on screen

UI Libraries
Launch
R

react-imgix

Add fast, responsive images as an image, picture, or background!

UI Libraries
Launch

react-container-query FAQ

What is React Container Query?

A React library that makes components respond to the size of their container, not the window.

How do I use the hook?

Call useContainerQuery with a query and an optional initial size. The README shows examples for a DOM element and for a React component container.

What if my container is a React component?

The component must forward its ref to the DOM element it renders, using React.forwardRef, so the size can be measured.

Is it open source?

The README says the code is provided under an open source license.

What are the best react-container-query alternatives?

Popular alternatives to react-container-query include react-height, react-resizable-box and react-resize-aware. See all react-container-query alternatives

Developer Stuff

Badges