@ic-pay/icpay-widget
v1.2.59
Published
ICPay embeddable payment widgets as framework-agnostic Web Components
Downloads
998
Readme
ICPay Widget (Web Components)
Embeddable, framework-agnostic payment widgets powered by @ic-pay/icpay-sdk.
Installation
Using pnpm:
pnpm add @ic-pay/icpay-widget @ic-pay/icpay-sdkUsing yarn:
yarn add @ic-pay/icpay-widget @ic-pay/icpay-sdkUsing npm:
npm install @ic-pay/icpay-widget @ic-pay/icpay-sdkComponents
icpay-pay-button— One‑click pay buttonicpay-amount-input— Enter custom amount, then payicpay-premium-content— Gated content unlockicpay-tip-jar— Tips/donationsicpay-article-paywall— Article paywall/unlockicpay-coffee-shop— Simple store with preset itemsicpay-donation-thermometer— Donation progress trackericpay-progress-bar— Transaction progress indicator
React bindings are available for all components via @ic-pay/icpay-widget/react.
Quick usage
HTML (with a bundler):
<script type="module">
import '@ic-pay/icpay-widget';
</script>
<icpay-pay-button
id="pay"
publishable-key="YOUR_PK"
token-shortcode="icp"
amount-usd="5"
></icpay-pay-button>React:
import { IcpayPayButton } from '@ic-pay/icpay-widget/react';
export default function Example() {
return (
<IcpayPayButton config={{ publishableKey: process.env.NEXT_PUBLIC_ICPAY_PK!, tokenShortcode: 'icp', amountUsd: 5 }} />
);
}Styling & theming
- Works out of the box. Customize with CSS variables on
:rootor the element. - A minimal Tailwind CSS build is available in
dist/tailwind.css(optional).
Documentation
Full component reference, theming, events, and examples: https://docs.icpay.org
