{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-tier-carousel",
  "type": "registry:component",
  "title": "Pricing Tier Carousel",
  "description": "Five plans in a 3D cover flow you can swipe, drag, click or drive with arrow keys. A price rail below places every tier on a log scale and a ring glides to the active one while the backdrop takes its color.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "pricing",
    "pricing",
    "carousel",
    "cover flow",
    "3d",
    "swipe",
    "tiers"
  ],
  "docs": "https://hyperblur.dev/effects/pricing-tier-carousel",
  "files": [
    {
      "path": "registry/hyperblur/pricing-tier-carousel.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/pricing-tier-carousel.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface PricingCarouselTier {\n  name: string;\n  audience: string;\n  price: number;\n  unit: string;\n  features: string[];\n  cta: { label: string; href: string };\n  color: string;\n}\n\nexport interface PricingTierCarouselProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onChange\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  tiers?: PricingCarouselTier[];\n  currency?: string;\n  locale?: string;\n  index?: number;\n  defaultIndex?: number;\n  onIndexChange?: (index: number, tier: PricingCarouselTier) => void;\n}\n\nconst defaultTiers: PricingCarouselTier[] = [\n  { name: \"Solo\", audience: \"One creator, one channel\", price: 9, unit: \"/ mo\", features: [\"1 brand profile\", \"30 scheduled posts\", \"Basic analytics\", \"Link-in-bio page\"], cta: { label: \"Choose Solo\", href: \"#\" }, color: \"#94a3b8\" },\n  { name: \"Creator\", audience: \"Growing a real audience\", price: 24, unit: \"/ mo\", features: [\"3 brand profiles\", \"Unlimited scheduling\", \"Best-time suggestions\", \"Caption library\"], cta: { label: \"Choose Creator\", href: \"#\" }, color: \"#34d399\" },\n  { name: \"Team\", audience: \"Agencies and small teams\", price: 59, unit: \"/ mo\", features: [\"10 brand profiles\", \"Approval queues\", \"Shared content calendar\", \"Client report PDFs\"], cta: { label: \"Choose Team\", href: \"#\" }, color: \"#2f7bff\" },\n  { name: \"Business\", audience: \"Brands across many markets\", price: 149, unit: \"/ mo\", features: [\"40 brand profiles\", \"Social listening\", \"Custom roles\", \"Priority support in 2h\"], cta: { label: \"Choose Business\", href: \"#\" }, color: \"#a78bfa\" },\n  { name: \"Network\", audience: \"Holding groups and franchises\", price: 399, unit: \"/ mo\", features: [\"Unlimited profiles\", \"SSO and audit log\", \"Regional workspaces\", \"Dedicated strategist\"], cta: { label: \"Talk to sales\", href: \"#\" }, color: \"#f5a524\" },\n];\n\nconst css = `\n.hb-vh5 {\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vh5 *, .hb-vh5 *::before, .hb-vh5 *::after { box-sizing: border-box; }\n.hb-vh5::before {\n  content: \"\";\n  position: absolute;\n  left: 50%;\n  top: 46%;\n  width: 760px;\n  height: 420px;\n  transform: translate(-50%, -50%);\n  background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-vh5-c) 22%, transparent), transparent);\n  transition: background .6s ease;\n  pointer-events: none;\n}\n.hb-vh5-inner { position: relative; max-width: 1080px; margin: 0 auto; padding: 64px 20px 56px; }\n.hb-vh5-head { text-align: center; display: grid; justify-items: center; gap: 10px; }\n.hb-vh5-eyebrow { margin: 0; color: #8f8f8f; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }\n.hb-vh5-title { margin: 0; max-width: 600px; font-family: var(--font-grotesk), var(--font-sans), sans-serif; font-size: clamp(28px, 4.6cqi, 46px); font-weight: 600; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }\n.hb-vh5-sub { margin: 0; max-width: 500px; color: #8f8f8f; font-size: 15px; line-height: 1.6; }\n.hb-vh5-stage {\n  position: relative;\n  height: 400px;\n  margin-top: 36px;\n  perspective: 1400px;\n  touch-action: pan-y;\n  outline: none;\n  cursor: grab;\n}\n.hb-vh5-stage:active { cursor: grabbing; }\n.hb-vh5-stage:focus-visible .hb-vh5-card[data-active=\"true\"] { outline: 2px solid var(--hb-vh5-c); outline-offset: 4px; }\n.hb-vh5-card {\n  --o: 0;\n  --ao: 0;\n  position: absolute;\n  left: 50%;\n  top: 0;\n  width: min(300px, 78cqi);\n  height: 380px;\n  margin-left: calc(min(300px, 78cqi) / -2);\n  display: flex;\n  flex-direction: column;\n  padding: 24px 22px 22px;\n  border-radius: 22px;\n  border: 1px solid rgba(255, 255, 255, .09);\n  background:\n    radial-gradient(120% 50% at 50% 0%, color-mix(in srgb, var(--tc) 16%, transparent), transparent 70%),\n    linear-gradient(180deg, #151517, #0e0e10);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 60px -30px rgba(0, 0, 0, .9);\n  transform: translateX(calc(var(--o) * min(232px, 44cqi))) translateZ(calc(var(--ao) * -160px)) rotateY(calc(var(--o) * -24deg));\n  opacity: calc(1 - var(--ao) * .32);\n  filter: brightness(calc(1 - var(--ao) * .28));\n  transition: transform .7s cubic-bezier(.22, 1, .36, 1), opacity .5s ease, filter .5s ease, border-color .4s ease;\n  user-select: none;\n}\n.hb-vh5-card[data-active=\"true\"] { border-color: color-mix(in srgb, var(--tc) 50%, transparent); }\n.hb-vh5-card[data-far=\"true\"] { opacity: 0; pointer-events: none; }\n.hb-vh5-cname { display: flex; align-items: center; justify-content: space-between; }\n.hb-vh5-cname h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }\n.hb-vh5-chip { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--tc), color-mix(in srgb, var(--tc) 40%, #000)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px -8px var(--tc); }\n.hb-vh5-aud { margin: 6px 0 0; color: #8f8f8f; font-size: 13.5px; }\n.hb-vh5-price { display: flex; align-items: baseline; gap: 6px; margin-top: 22px; }\n.hb-vh5-price strong { font-family: var(--font-grotesk), var(--font-sans), sans-serif; font-size: 48px; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }\n.hb-vh5-price span { color: #8f8f8f; font-size: 14px; }\n.hb-vh5-list { display: grid; gap: 10px; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid rgba(255, 255, 255, .07); list-style: none; }\n.hb-vh5-list li { display: flex; align-items: center; gap: 10px; color: #b5b5b5; font-size: 13.5px; }\n.hb-vh5-list li::before { content: \"\"; flex: none; width: 5px; height: 5px; border-radius: 999px; background: var(--tc); }\n.hb-vh5-cta {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  height: 44px;\n  margin-top: auto;\n  border-radius: 12px;\n  background: #ededed;\n  color: #0a0a0a;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: background-color .2s ease, transform .15s ease;\n}\n.hb-vh5-card:not([data-active=\"true\"]) .hb-vh5-cta { background: rgba(255, 255, 255, .06); color: #8f8f8f; }\n.hb-vh5-cta:hover { background: #fff; }\n.hb-vh5-cta:active { transform: scale(.98); }\n.hb-vh5-cta:focus-visible { outline: 2px solid var(--tc); outline-offset: 2px; }\n.hb-vh5-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }\n.hb-vh5-arrow {\n  display: grid;\n  place-items: center;\n  width: 40px;\n  height: 40px;\n  padding: 0;\n  border-radius: 999px;\n  border: 1px solid rgba(255, 255, 255, .1);\n  background: #121214;\n  color: #ededed;\n  cursor: pointer;\n  transition: background-color .2s ease, border-color .2s ease, transform .2s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;\n}\n.hb-vh5-arrow svg { width: 16px; height: 16px; }\n.hb-vh5-arrow:hover { background: #1b1b1e; border-color: rgba(255, 255, 255, .2); }\n.hb-vh5-arrow:active { transform: scale(.92); }\n.hb-vh5-arrow:disabled { opacity: .35; cursor: default; transform: none; }\n.hb-vh5-arrow:focus-visible { outline: 2px solid var(--hb-vh5-c); outline-offset: 2px; }\n.hb-vh5-rail { position: relative; width: min(420px, 60cqi); height: 40px; }\n.hb-vh5-line { position: absolute; left: 0; right: 0; top: 13px; height: 2px; border-radius: 2px; background: #232326; }\n.hb-vh5-tick {\n  position: absolute;\n  top: 6px;\n  width: 16px;\n  height: 16px;\n  margin-left: -8px;\n  padding: 0;\n  border: 0;\n  border-radius: 999px;\n  background: transparent;\n  cursor: pointer;\n}\n.hb-vh5-tick::before { content: \"\"; position: absolute; inset: 4px; border-radius: 999px; background: #3a3a40; transition: background-color .3s ease, transform .3s ease; }\n.hb-vh5-tick[aria-current=\"true\"]::before { background: var(--tc); transform: scale(1.3); }\n.hb-vh5-tick:focus-visible { outline: 2px solid var(--tc); outline-offset: 1px; }\n.hb-vh5-tick span { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); color: #6f6f6f; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color .3s ease; }\n.hb-vh5-tick[aria-current=\"true\"] span { color: #ededed; }\n.hb-vh5-marker { position: absolute; top: 5px; width: 18px; height: 18px; margin-left: -9px; border-radius: 999px; border: 2px solid var(--hb-vh5-c); box-shadow: 0 0 14px var(--hb-vh5-c); transition: left .7s cubic-bezier(.22, 1, .36, 1), border-color .4s ease; pointer-events: none; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-vh5 *, .hb-vh5 *::before, .hb-vh5 *::after { transition: none !important; }\n}\n`;\n\nexport function PricingTierCarousel({\n  eyebrow = \"Plans\",\n  title = \"Find the plan that matches your reach\",\n  subtitle = \"Swipe, drag or use the arrow keys. Every plan starts with a 14-day trial and no card.\",\n  tiers = defaultTiers,\n  currency = \"USD\",\n  locale = \"en-US\",\n  index,\n  defaultIndex = 2,\n  onIndexChange,\n  className = \"\",\n  style,\n  ...rest\n}: PricingTierCarouselProps) {\n  const [inner, setInner] = React.useState(defaultIndex);\n  const active = Math.max(0, Math.min(tiers.length - 1, index ?? inner));\n  const drag = React.useRef<{ x: number; id: number } | null>(null);\n  const swiped = React.useRef(false);\n  const money = React.useMemo(\n    () => new Intl.NumberFormat(locale, { style: \"currency\", currency, maximumFractionDigits: 0 }),\n    [locale, currency],\n  );\n\n  const go = (i: number) => {\n    const next = Math.max(0, Math.min(tiers.length - 1, i));\n    if (next === active) return;\n    if (index === undefined) setInner(next);\n    onIndexChange?.(next, tiers[next]);\n  };\n\n  const onKey = (e: React.KeyboardEvent) => {\n    if (e.key === \"ArrowRight\") { e.preventDefault(); go(active + 1); }\n    else if (e.key === \"ArrowLeft\") { e.preventDefault(); go(active - 1); }\n    else if (e.key === \"Home\") { e.preventDefault(); go(0); }\n    else if (e.key === \"End\") { e.preventDefault(); go(tiers.length - 1); }\n  };\n\n  const onDown = (e: React.PointerEvent) => {\n    drag.current = { x: e.clientX, id: e.pointerId };\n    swiped.current = false;\n  };\n  const onUp = (e: React.PointerEvent) => {\n    const d = drag.current;\n    drag.current = null;\n    if (!d || d.id !== e.pointerId) return;\n    const dx = e.clientX - d.x;\n    if (Math.abs(dx) > 40) {\n      swiped.current = true;\n      go(active + (dx < 0 ? 1 : -1));\n    }\n  };\n\n  const prices = tiers.map((t) => Math.log(t.price + 1));\n  const lo = Math.min(...prices);\n  const hi = Math.max(...prices);\n  const pos = (i: number) => (hi === lo ? 50 : ((prices[i] - lo) / (hi - lo)) * 100);\n  const color = tiers[active]?.color ?? \"#2f7bff\";\n\n  return (\n    <section className={`hb-vh5 ${className}`} style={{ \"--hb-vh5-c\": color, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-pricing-tier-carousel\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vh5-inner\">\n        <div className=\"hb-vh5-head\">\n          {eyebrow ? <p className=\"hb-vh5-eyebrow\">{eyebrow}</p> : null}\n          <h2 className=\"hb-vh5-title\">{title}</h2>\n          {subtitle ? <p className=\"hb-vh5-sub\">{subtitle}</p> : null}\n        </div>\n        <div\n          className=\"hb-vh5-stage\"\n          tabIndex={0}\n          role=\"group\"\n          aria-roledescription=\"carousel\"\n          aria-label={`Plans, ${tiers[active]?.name} selected, ${active + 1} of ${tiers.length}`}\n          onKeyDown={onKey}\n          onPointerDown={onDown}\n          onPointerUp={onUp}\n          onPointerCancel={() => { drag.current = null; }}\n        >\n          {tiers.map((t, i) => {\n            const o = i - active;\n            const ao = Math.abs(o);\n            return (\n              <article\n                key={t.name}\n                className=\"hb-vh5-card\"\n                data-active={o === 0 ? \"true\" : undefined}\n                data-far={ao > 2 ? \"true\" : undefined}\n                aria-hidden={o !== 0}\n                style={{ \"--o\": o, \"--ao\": ao, \"--tc\": t.color, zIndex: 10 - ao } as React.CSSProperties}\n                onClick={() => {\n                  if (swiped.current) { swiped.current = false; return; }\n                  if (o !== 0) go(i);\n                }}\n              >\n                <div className=\"hb-vh5-cname\">\n                  <h3>{t.name}</h3>\n                  <span className=\"hb-vh5-chip\" aria-hidden=\"true\" />\n                </div>\n                <p className=\"hb-vh5-aud\">{t.audience}</p>\n                <div className=\"hb-vh5-price\">\n                  <strong>{money.format(t.price)}</strong>\n                  <span>{t.unit}</span>\n                </div>\n                <ul className=\"hb-vh5-list\">\n                  {t.features.map((f) => <li key={f}>{f}</li>)}\n                </ul>\n                <a className=\"hb-vh5-cta\" href={t.cta.href} tabIndex={o === 0 ? 0 : -1}>{t.cta.label}</a>\n              </article>\n            );\n          })}\n        </div>\n        <div className=\"hb-vh5-nav\">\n          <button type=\"button\" className=\"hb-vh5-arrow\" aria-label=\"Previous plan\" disabled={active === 0} onClick={() => go(active - 1)}>\n            <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M10 3.5L5.5 8l4.5 4.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n          </button>\n          <div className=\"hb-vh5-rail\">\n            <div className=\"hb-vh5-line\" />\n            {tiers.map((t, i) => (\n              <button\n                key={t.name}\n                type=\"button\"\n                className=\"hb-vh5-tick\"\n                style={{ left: `${pos(i).toFixed(2)}%`, \"--tc\": t.color } as React.CSSProperties}\n                aria-current={i === active ? \"true\" : undefined}\n                aria-label={`${t.name}, ${money.format(t.price)} ${t.unit}`}\n                onClick={() => go(i)}\n              >\n                <span>{money.format(t.price)}</span>\n              </button>\n            ))}\n            <div className=\"hb-vh5-marker\" style={{ left: `${pos(active).toFixed(2)}%` }} aria-hidden=\"true\" />\n          </div>\n          <button type=\"button\" className=\"hb-vh5-arrow\" aria-label=\"Next plan\" disabled={active === tiers.length - 1} onClick={() => go(active + 1)}>\n            <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M6 3.5L10.5 8 6 12.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n          </button>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}