# ReactTraining/react-media

CSS media queries for React

Repository: https://github.com/ReactTraining/react-media
Canonical: https://ross.abutalabs.com/products/react-media
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2020-07-15T09:45:27+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3682, "days_push": 2240, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2422, forks 114 (observed 2026-08-28T04:06:50.640545+00:00)

## What it is
react-media is a React component and hook library for matching CSS media queries in JavaScript. It renders children or returns match results based on whether media queries like breakpoints match the current viewport.

## Use cases
- render different components for mobile vs desktop breakpoints
- conditionally show elements based on screen width in React
- use a useMedia hook to check if viewport matches a media query
- build responsive layouts without CSS-only hiding
- match multiple named breakpoints at once in a React app

## When to choose
- you need JS-driven responsive rendering in React components
- you want a small, focused media query matching utility with hook support

## When to avoid
- you only need CSS-based responsiveness with no JS logic
- you use a non-React framework
- you need actively maintained software with recent releases

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, state-management
- domain: frontend, web-development
- platform: browser, cross-platform
- tags: react, media-queries, responsive, hooks, css, responsive-design, nodejs

## Member repositories
- ReactTraining/react-media (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:50.640545+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:33:01.657748+00:00, confidence not recorded.
  - readme: https://github.com/ReactTraining/react-media (fetched 2026-08-28T04:06:50.640545+00:00, sha 3d04b393b4c3)
  - registry_npm: https://registry.npmjs.org/react-media (fetched 2026-08-29T10:13:35.766625+00:00, sha f1ae3ee0d459)
- Data as of 2026-08-30T08:39:29.467469+00:00.
