npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stripe-payment-element

v1.0.1

Published

A web component to accept payments using Stripe's Payment Element

Downloads

273

Readme

<stripe-payment-element>

npm package version Build status

💳 A web component to accept payments using Stripe's Payment Element.

<stripe-payment-element
  publishable-key="your_publishable_key"
  mode="payment"
  amount="100"
  currency="usd"
></stripe-payment-element>

[!IMPORTANT] Stripe.js is automatically loaded via esm.sh if the global Stripe function is undefined, see Options.

View demo →

Installation

Via package manager

npm install stripe-payment-element
import 'stripe-payment-element/register'

Via <script> tag

Download the latest release from npm:

npm pack stripe-payment-element

Then unpack it into your project and:

<!-- host yourself -->
<script type="module" src="register.js"></script>

Or embed from a third-party CDN (not recommended for production use):

<!-- esm.sh CDN -->
<script type="module" src="https://esm.sh/stripe-payment-element/register"></script>
<!-- UNPKG CDN -->
<script type="module" src="https://www.unpkg.com/stripe-payment-element/register"></script>

[!TIP] Specify a fully resolved package version number to avoid redirects and breaking changes.

Options

| Property | Attribute | Type | Required | Description | | ----------------------------- | -------------------------------- | :------: | :------: | ------------------------------------------------------------ | | stripeJsVersion | stripe-js-version | string | | Stripe.js version to load if not present. Defaults to 9. | | advancedFraudSignals | advanced-fraud-signals | boolean | | See Advanced fraud detection | | publishableKey | publishable-key | string | ✓ | See Stripe.js reference | | stripeAccount | stripe-account | string | | See Stripe.js reference | | apiVersion | api-version | string | | See Stripe.js reference | | locale | locale | string | | See Stripe.js reference | | betas | betas | string[] | | See Stripe.js documentation | | developerTools | developer-tools | object | | See Stripe.js reference | | fonts | fonts | object[] | | See Stripe.js reference | | loader | loader | string | | See Stripe.js reference | | customerOptions | customer-options | object | | See Stripe.js documentation | | customerSessionClientSecret | customer-session-client-secret | string | | See Stripe.js reference | | customPaymentMethods | custom-payment-methods | object[] | | See Stripe.js reference | | syncAddressCheckbox | sync-address-checkbox | string | | See Stripe.js reference | | paymentMethodCreation | payment-method-creation | string | | See Stripe.js reference | | disableAnimations | disable-animations | boolean | | See Elements Appearance API | | theme | theme | string | | See Elements Appearance API | | variables | variables | object | | See Elements Appearance API | | rules | rules | object | | See Elements Appearance API | | labels | labels | string | | See Elements Appearance API | | inputs | inputs | string | | See Elements Appearance API | | mode | mode | string | ✓* | See Stripe.js reference | | amount | amount | number | ✓* | See Stripe.js reference | | currency | currency | string | ✓* | See Stripe.js reference | | setupFutureUsage | setup-future-usage | string | | See Stripe.js reference | | captureMethod | capture-method | string | | See Stripe.js reference | | onBehalfOf | on-behalf-of | string | | See Stripe.js reference | | paymentMethodTypes | payment-method-types | string[] | | See Stripe.js reference | | excludedPaymentMethodTypes | excluded-payment-method-types | string[] | | See Stripe.js reference | | allowedPaymentMethodTypes | allowed-payment-method-types | string[] | | See Stripe.js reference | | paymentMethodConfiguration | payment-method-configuration | string | | See Stripe.js reference | | paymentMethodOptions | payment-method-options | object | | See Stripe.js reference | | clientSecret | client-secret | string | ✓* | See Stripe.js reference | | externalPaymentMethodTypes | external-payment-method-types | string[] | | See Stripe.js reference | | defaultValues | default-values | object | | See Stripe.js reference | | business | business | object | | See Stripe.js reference | | paymentMethodOrder | payment-method-order | string[] | | See Stripe.js reference | | fields | fields | object | | See Stripe.js reference | | readOnly | read-only | boolean | | See Stripe.js reference | | terms | terms | object | | See Stripe.js reference | | wallets | wallets | object | | See Stripe.js reference | | layout | layout | string | | See Stripe.js reference | | applePay | apple-pay | object | | See Stripe.js reference |

* conditionally required

Events

| Event | Description | | -------------------------- | ------------------------------------------------------------------------- | | change | Fired when the element's value changes. | | ready | Fired when the element is fully rendered. | | focus | Fired when the element gains focus. | | blur | Fired when the element loses focus. | | escape | Fired when the Esc key is pressed within the element. | | loaderror | Fired when the element fails to load. | | loaderstart | Fired when the loader UI is mounted to the DOM and ready to be displayed. | | carddetailschange | Fired when the details of a selected card payment method changes. | | savedpaymentmethodupdate | Fired when a saved payment method is updated. | | savedpaymentmethodremove | Fired when a saved payment method is removed. |