
React Cosmos
Sandbox for developing and testing React UI components in isolation, with file-based fixtures, a playground interface and a static export.
reactcosmos.orgrepositorydocsplugins
React Cosmos renders React UI components outside the app that uses them. Each state of a component is a fixture, defined by a file-system convention. A playground lets a developer browse the fixtures and change their inputs.
The cosmos command starts the dev server. The cosmos-export command writes a static build of the component library, which the static export page says can be deployed to any static hosting service. The guides cover Vite, Webpack, React Native and Next.js, and the Webpack guide installs the project with npm alongside a plugin.
Worth knowing
The static export does not have every development feature. The export page says it cannot open the selected fixture in the code editor, but anyone with the export URL can browse fixtures and play with component inputs.
Identity
Rendering and deploy
- Runs as
- Dev only, Static files56
- Install with
- npm i -D react-cosmos react-cosmos-plugin-webpack7
Releases
Adoption
Sources
- 2026-10-28: links, Built on, Categories, Written in
reactcosmos.org - 2026-10-28: links, License, GitHub stars
api.github.com/repos/react-cosmos/react-cosmos - 2026-10-28: links
reactcosmos.org/docs/getting-started - 2026-10-28: Maintainer, License
raw.githubusercontent.com/react-cosmos/react-cosmos/main/LICENSE - 2026-10-28: Runs as
reactcosmos.org/docs/cli - 2026-10-28: Runs as
reactcosmos.org/docs/static-export - 2026-10-28: Install with
reactcosmos.org/docs/getting-started/webpack - 2026-10-28: First release, Current major version, Last release
api.github.com/repos/react-cosmos/react-cosmos/releases - 2026-10-28: Contributors
api.github.com/repos/react-cosmos/react-cosmos/contributors - 2026-10-28: npm downloads a week
api.npmjs.org/downloads/range/2026-09-28:2026-10-04/react-cosmos - 2026-10-28: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/react-cosmos - 2026-10-28: links
reactcosmos.org/docs/plugins