# eBay/nice-modal-react

A modal state manager for React.

Repository: https://github.com/eBay/nice-modal-react
Canonical: https://ross.abutalabs.com/products/nice-modal-react
Homepage: https://ebay.github.io/nice-modal-react
Language: TypeScript
License: MIT
License Family: permissive
Topics: react, modal
Last push: 2026-08-11T10:40:21+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 8, longevity 100
- inputs: {"age_days": 1835, "days_push": 22, "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 2296, forks 127 (observed 2026-08-28T04:06:35.118126+00:00)

## What it is
A small, zero-dependency React utility for managing modal state globally via context, allowing modals to be shown or hidden by component reference or registered id. It is not a modal component itself but works with any UI library's modal/dialog implementation.

## Use cases
- show modals anywhere in a react app without prop drilling
- manage modal visibility by id instead of importing components
- get promise-based results when a modal task completes
- avoid remounting modals and breaking css transitions
- integrate modal state management with material ui or ant design
- keep modal component code unexecuted until the modal is shown

## When to choose
- you use react and juggle many modals across a large component tree
- you want promise-based interaction with modal results
- you want a tiny (~2kb) zero-dependency modal state solution
- you want modals decoupled from their call sites via string ids

## When to avoid
- you need an actual modal/dialog UI component rather than state management
- your app uses vue, svelte, or another non-react framework
- you already use a UI library whose modal API meets your needs
- you need complex workflow or wizard orchestration beyond simple show/hide

## Facets
- artifact type: library
- maturity: stable
- function: state-management, ui-components, frontend-framework
- domain: web-development, frontend, developer-tools
- platform: cross-platform
- tags: react, modal, modals, promise-based, zero-dependency, typescript, web-server, nodejs

## Member repositories
- eBay/nice-modal-react (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:35.118126+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:40:19.743791+00:00, confidence not recorded.
  - readme: https://github.com/eBay/nice-modal-react (fetched 2026-08-28T04:06:35.118126+00:00, sha cb298ba50d9b)
  - homepage: https://ebay.github.io/nice-modal-react (fetched 2026-08-29T10:21:01.743190+00:00, sha be0ddd4810b9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
