Sourcemap Explorer
Stack · npm package

@stripe/react-stripe-js

React components for Stripe.js and Stripe Elements

latest 7.0.0· MIT· 113 versions publishedView on npm

About

React components for Stripe.js and Stripe Elements

ReactStripeElements

What detecting @stripe/react-stripe-js tells you about a site

This package is one of the most commercially revealing things you can find in a bundle: it means the site takes payments, and does so through Stripe Elements. Its presence tells you there is a checkout, a subscription flow or a billing page, and that card data is being handled through Stripe's hosted iframes rather than touched directly, which is a strong PCI-compliance signal. Finding it confirms a real monetisation path in the product and usually a fairly considered front-end, since the React wrapper implies the team integrated Stripe properly through provider components rather than dropping in a raw script.

Why the exact @stripe/react-stripe-js version matters

The React wrapper version is paired with a specific generation of Stripe.js and the Elements API; newer majors added support for the Payment Element and embedded checkout, which replaced the older card-specific elements. The exact version tells you which payment UI generation the site uses, and whether it is on the modern unified Payment Element or the legacy individual card fields.

@stripe/react-stripe-js in a real-world stack

When you find @stripe/react-stripe-js in a bundle, it rarely travels alone. @stripe/stripe-js loads the underlying script, and the pair almost always appears together.

Quick facts

Latest version7.0.0
LicenseMIT
AuthorStripe
Homepagestripe.com
Installnpm install @stripe/react-stripe-js
Direct dependencies1
Peer dependenciesreact, react-dom, @stripe/stripe-js

Common pairings

Packages this one expects to find in the same project. Each is also a Sourcemap Explorer detection target.

What @stripe/react-stripe-js pulls in

@stripe/react-stripe-js declares 1 direct dependency — each one also rides into any bundle that ships @stripe/react-stripe-js, so they are detection targets too. Reading them is a quick way to understand the package's real footprint .

prop-types

How Sourcemap Explorer detects @stripe/react-stripe-js

@stripe/react-stripe-js ships as v7.0.0, published 2026-10-01 and carries 1 direct dependency, 3 peer dependencies (react, react-dom, @stripe/stripe-js), 113 versions on the registry. Those exact numbers are the footprint Sourcemap Explorer matches when @stripe/react-stripe-js rides inside a deployed bundle — here is how the detection works.

We catch @stripe/react-stripe-js from two complementary signals: bundled source paths and the embedded package.json. Modern bundlers (webpack, Vite, esbuild, Rollup, Turbopack) preserve the original node_modules/@stripe/react-stripe-js/ paths inside the JavaScript sourcemap's sources[] array — that's the canonical signal. When the matching package.json is also captured in sourcesContent[], we read the exact version field — patch number included. No regex guessing, no version inference.

  1. 1

    Confirm the site exposes sourcemaps

    In DevTools Network, check the response headers of any application script for `SourceMap` or `X-SourceMap`. Failing that, fetch the script's last 4 KB and look for a `//# sourceMappingURL=` comment — that map is where the `@stripe/react-stripe-js` paths live.

  2. 2

    Find the package in the bundle

    Open DevTools → Network → reload. Click any application script and look at its sourcemap. Inside, search `sources[]` for entries matching `node_modules/@stripe/react-stripe-js/` — every match confirms the package is bundled. The matching `sourcesContent[i]` for `node_modules/@stripe/react-stripe-js/package.json` gives you the exact installed version.

  3. 3

    Read the version directly from package.json

    Run `jq -r '. as $m | $m.sources | to_entries[] | select(.value | endswith("node_modules/@stripe/react-stripe-js/package.json")) | $m.sourcesContent[.key] | fromjson | .version' bundle.js.map`. Sourcemap Explorer automates the same query in the popup.

Major releases of @stripe/react-stripe-js

When each major version first landed. Major bumps are where breaking changes live, so this timeline is the fastest way to date the @stripe/react-stripe-js version a site actually ships against the ecosystem.

Major
First release
Date
v7
7.0.0
2026-10-01
v6
6.0.0
2026-03-26
v5
5.0.0
2025-10-01
v4
4.0.0
2025-09-02
v3
3.0.0
2024-11-19
v2
2.0.0
2023-03-13

Recent versions

Version
Released
7.0.0
2026-10-01
6.12.0
2026-09-23
6.11.0
2026-09-21
6.10.0
2026-09-10
6.9.0
2026-09-03
6.8.2
2026-08-20
6.8.1
2026-08-10
6.8.0
2026-07-15

@stripe/react-stripe-js README

Live mirror of the GitHub README, for reference. Updated whenever the repo's default branch changes.

React Stripe.js

React components for Stripe.js and Elements.

npm version

Requirements

The minimum supported version of React is v16.8. If you use an older version, upgrade React to use this library. If you prefer not to upgrade your React version, we recommend using legacy react-stripe-elements.

Getting started

Documentation

Build a custom checkout page

For a new custom checkout page, we recommend the Checkout Sessions API with ui_mode: 'elements'. This lets you combine Stripe Elements with your own React layout while Checkout Sessions manages the checkout state. If you want to own every part of your checkout, the lower-level Payment Intents API provides more fine-grained control, but requires significantly more code and ongoing maintenance.

First, install React Stripe.js and Stripe.js.

npm install @stripe/react-stripe-js @stripe/stripe-js

Create a Checkout Session on your server using trusted product and pricing data, then return its client secret:

// POST /create-checkout-session
const session = await stripe.checkout.sessions.create({
  ui_mode: 'elements',
  mode: 'payment',
  return_url: 'https://example.com/order/123/complete',
  line_items: [
    {
      price_data: {
        currency: 'usd',
        product_data: {name: 'T-shirt'},
        unit_amount: 1099,
      },
      quantity: 1,
    },
  ],
});

if (!session.client_secret) {
  throw new Error('Checkout Session is missing a client secret.');
}

res.json({clientSecret: session.client_secret});

Client:

import React, {useState} from 'react';
import {createRoot} from 'react-dom/client';
import {loadStripe} from '@stripe/stripe-js';
import {
  PaymentElement,
  CheckoutElementsProvider,
  useCheckoutElements,
} from '@stripe/react-stripe-js/checkout';

const CheckoutForm = () => {
  const result = useCheckoutElements();
  const [errorMessage, setErrorMessage] = useState(null);
  const [isSubmitting, setIsSubmitting] = useState(false);

  const handleSubmit = async (event) => {
    event.preventDefault();

    if (result.type !== 'success' || !result.checkout.canConfirm) {
      return;
    }

    setIsSubmitting(true);
    setErrorMessage(null);

    try {
      const confirmResult = await result.checkout.confirm({
        returnUrl: 'https://example.com/order/123/complete',
      });

      if (confirmResult.type === 'error') {
        setErrorMessage(confirmResult.error.message);
      }
    } catch (error) {
      setErrorMessage(
        error instanceof Error ? error.message : 'An unexpected error occurred.'
      );
    } finally {
      setIsSubmitting(false);
    }
  };

  if (result.type === 'loading') {
    return <div>Loading checkout...</div>;
  }

  if (result.type === 'error') {
    return <div>{result.error.message}</div>;
  }

  const {checkout} = result;

  return (
    <>
      <ul>
        {checkout.lineItems.map((lineItem) => (
          <li key={lineItem.id}>
            {lineItem.name}: {lineItem.total.amount}
          </li>
        ))}
      </ul>
      <p>Total: {checkout.total.total.amount}</p>
      <form onSubmit={handleSubmit}>
        <PaymentElement />
        <button type="submit" disabled={!checkout.canConfirm || isSubmitting}>
          {isSubmitting ? 'Processing...' : 'Pay'}
        </button>
        {errorMessage && <div>{errorMessage}</div>}
      </form>
    </>
  );
};

// Use the publishable key for the same account that created the Checkout Session.
const stripePromise = loadStripe('pk_test_...');

const clientSecretPromise = fetch('/create-checkout-session', {
  method: 'POST',
}).then(async (response) => {
  const body = await response.json();

  if (!response.ok) {
    throw new Error(body.error ?? 'Unable to create a Checkout Session.');
  }

  return body.clientSecret;
});

const options = {
  clientSecret: clientSecretPromise,
  elementsOptions: {
    appearance: {
      theme: 'stripe',
    },
  },
};

const App = () => (
  <CheckoutElementsProvider stripe={stripePromise} options={options}>
    <CheckoutForm />
  </CheckoutElementsProvider>
);

createRoot(document.getElementById('root')).render(<App />);

TypeScript support

React Stripe.js is packaged with TypeScript declarations. Some types are pulled from @stripe/stripe-js—be sure to add @stripe/stripe-js as a dependency to your project for full TypeScript support.

Typings in React Stripe.js follow the same versioning policy as @stripe/stripe-js.

Contributing

This project is maintained by Stripe and does not accept external pull requests. If you have feedback or ideas, please open an issue.

FAQ

What is @stripe/react-stripe-js used for?

React components for Stripe.js and Stripe Elements

How can I tell if a website is using @stripe/react-stripe-js?

Open the page in Chrome with the Sourcemap Explorer extension installed and read the Stack tab. We catch `@stripe/react-stripe-js` from two complementary signals: `node_modules/@stripe/react-stripe-js/` paths inside the JavaScript sourcemap, and the embedded `package.json` we read for exact-version detection. Without the extension you can do the same lookup manually in DevTools — the steps are listed in the "How Sourcemap Explorer detects" section above.

How do I find out which version of @stripe/react-stripe-js a website is running?

Read it straight from the site's JavaScript sourcemap. When a build ships source maps, the bundled `@stripe/react-stripe-js/package.json` carries the exact `version` string — Sourcemap Explorer extracts it in one click on the Stack tab, and you can do it by hand in DevTools by opening the `.map` file and searching for `node_modules/@stripe/react-stripe-js/package.json`. That is far more reliable than inferring the version from an asset-hash or a `?ver=` query string, which is all surface-level detectors have to go on. The current npm release is 7.0.0, but real deployments frequently run an older pinned version — which is exactly why reading the bundled number matters.

What is the latest version of @stripe/react-stripe-js?

7.0.0, as published on the npm registry. The "Recent versions" table on this page lists the most recent 8 releases with their release dates. Sourcemap Explorer reports the version actually bundled into a site, which can lag the latest release by months on real-world deployments.

Is @stripe/react-stripe-js actively maintained?

Very actively maintained — the last release shipped within the past three months. The last published release was 2026-10-01. Source code: https://github.com/stripe/react-stripe-js.

Where can I read more?

Project homepage: https://stripe.com. Source code: https://github.com/stripe/react-stripe-js. Published on npm: https://www.npmjs.com/package/@stripe/react-stripe-js. Licensed as MIT.

Keep reading on Sourcemap Explorer

Detected by Sourcemap Explorer

When a bundle ships sourcemaps, we read the embedded package.json for @stripe/react-stripe-js and report the precise version (the registry's latest is v7.0.0, published 2026-10-01; the bundled copy is often older). Without sourcemaps, an import / require in the page's scripts is enough to flag it.

Install free on Chrome