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

santander-calc

v1.0.5

Published

Santander revolving credit calculator widget — React component and vanilla JS loader

Readme

santander-calc

Santander revolving credit calculator widget. Works in plain HTML and React / Next.js.


How it works

The widget renders an inline button that opens a modal showing the revolving credit repayment schedule. All calculations happen in the browser — no backend required.


Plain HTML

Drop the <script> tag wherever you want the button to appear:

<script
  src="https://cdn.jsdelivr.net/npm/santander-calc/loader.js"
  data-total="1250"
  data-lang="fr">
</script>

Available attributes

| Attribute | Description | Default | |---|---|---| | data-total | Total amount in euros | 0 | | data-lang | Language: fr en nl de | fr | | data-primary | Primary hex color | #e60000 | | data-bg | Modal background color (hex) | #ffffff | | data-header-bg | Modal header background (hex) | same as primary | | data-header-fg | Modal header text color (hex) | #ffffff | | data-btn-text | Custom button label (overrides auto-translation) | auto-translated | | data-width | Button width | auto | | data-height | Button height | 50px |

Full example

<script
  src="https://cdn.jsdelivr.net/npm/santander-calc/loader.js"
  data-total="2500"
  data-lang="fr"
  data-primary="#e60000"
  data-bg="#ffffff"
  data-header-bg="#e60000"
  data-header-fg="#ffffff"
  data-btn-text="Voir l'échéancier"
  data-width="100%">
</script>

Platform examples

Shopify Liquid:

<script
  src="https://cdn.jsdelivr.net/npm/santander-calc/loader.js"
  data-total="{{ cart.total_price | divided_by: 100.0 }}"
  data-lang="{{ request.locale.iso_code }}">
</script>

PHP / WordPress:

<script
  src="https://cdn.jsdelivr.net/npm/santander-calc/loader.js"
  data-total="<?= $cart_total ?>"
  data-lang="<?= $locale ?>">
</script>

React / Next.js

Installation

npm install santander-calc

Usage

import { SantanderCalcButton } from "santander-calc";

export default function CartPage() {
  return (
    <div>
      <button>Checkout</button>
      <SantanderCalcButton total={1250} lang="fr" />
    </div>
  );
}

Props

| Prop | Type | Description | Default | |---|---|---|---| | total | number | Total amount in euros | — | | lang | "fr" \| "en" \| "nl" \| "de" | Language | "fr" | | primary | string | Primary hex color | "#e60000" | | bg | string | Modal background color | "#ffffff" | | headerBg | string | Modal header background | same as primary | | headerFg | string | Modal header text color | "#ffffff" | | btnText | string | Custom button label | auto-translated | | className | string | CSS class on the button | — | | style | object | Inline styles on the button | — |

Button label — The button text is automatically translated based on lang: fr → "Voir l'échéancier" · en → "See schedule" · nl → "Schema bekijken" · de → "Plan anzeigen" Use btnText to override with a fixed label regardless of language.

Full example

<SantanderCalcButton
  total={2500}
  lang="fr"
  primary="#e60000"
  bg="#ffffff"
  headerBg="#e60000"
  headerFg="#ffffff"
  btnText="Voir l'échéancier"
  className="my-button-class"
  style={{ marginTop: "12px", width: "100%" }}
/>

Next.js (App Router)

The component already includes "use client" and can be imported directly in Server Components:

// app/cart/page.tsx (Server Component)
import { SantanderCalcButton } from "santander-calc";

export default async function CartPage() {
  const cart = await getCart();
  return (
    <SantanderCalcButton total={cart.total} lang="fr" />
  );
}

Supported languages

| Code | Language | |---|---| | fr | Français | | en | English | | nl | Nederlands | | de | Deutsch |


Amount ranges

The calculator automatically selects the correct repayment schedule based on the total:

| Range | Interval | |---|---| | A | € 0 – € 1,250 | | B | € 1,250 – € 5,000 | | C | € 5,001 + |


License

UNLICENSED — private use only.