Staaarter

Currency Region Toggle

Pricing cards paired with a segmented-control toggle above them for switching the displayed currency. Each tier carries a static price per currency in its data (matching how real localized pricing pages work), and the toggle genuinely swaps which value is shown, it does not perform a live conversion.

By Staaarter Team
Pricing
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/currency-region-toggle.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/pricing/pricing14.tsx instead.

Usage

The file also exports pricing14Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Pricing14, pricing14Demo } from "@/components/blocks/pricing/pricing14";

export default function Page() {
  return <Pricing14 {...pricing14Demo} />;
}

Props

PropTypeDefaultDescription
headingReactNodenoneMain section headline.
descriptionstringundefinedSupporting subtext below the heading.
currenciesPricing14Currency[]noneCurrency options shown in the toggle, in display order.
tiersPricing14Tier[]noneThe pricing cards to render, each with a price per currency code.
defaultCurrencystringcurrencies[0]?.codeCurrency code selected on mount.
classNamestringnoneExtra classes for the outer section element.

Types

type Pricing14Currency = { code: string; symbol: string; label: string };

type Pricing14Tier = {
  name: string;
  description?: string;
  prices: Record<string, string>; // keyed by currency code
  period?: string;
  features: string[];
  cta: { label: string; href?: string };
  highlighted?: boolean;
};

Behavior notes

  • The currency toggle is real local state (useState): clicking a currency option genuinely swaps every tier's displayed price and symbol, it is not decorative.
  • Prices are not converted live, each currency's value comes from a fixed lookup already present in the tier's `prices` object, matching how real pricing pages store per-region prices rather than computing an exchange rate on the fly.
  • The toggle is a real radiogroup (role="radiogroup" with role="radio"/aria-checked on each option) for screen reader support, not a set of plain unlabeled buttons.
  • All CTA buttons are inert placeholders (href defaults to "#" in the demo) with no real navigation or checkout wired up.