{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-toggle-burst",
  "type": "registry:component",
  "title": "Pricing Toggle Burst",
  "description": "Three plans with a spring-loaded monthly and yearly switch. Going yearly fires a burst of shards from the discount badge, strikes through the old price and slides in the yearly saving on every card.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "pricing",
    "pricing",
    "billing toggle",
    "discount",
    "burst",
    "plans",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/pricing-toggle-burst",
  "files": [
    {
      "path": "registry/hyperblur/pricing-toggle-burst.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/pricing-toggle-burst.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type PricingToggleBurstPeriod = \"monthly\" | \"yearly\";\n\nexport interface PricingToggleBurstPlan {\n  name: string;\n  tagline: string;\n  monthly: number;\n  yearly: number;\n  features: string[];\n  cta: { label: string; href: string };\n  featured?: boolean;\n}\n\nexport interface PricingToggleBurstProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  plans?: PricingToggleBurstPlan[];\n  currency?: string;\n  locale?: string;\n  period?: PricingToggleBurstPeriod;\n  defaultPeriod?: PricingToggleBurstPeriod;\n  onPeriodChange?: (period: PricingToggleBurstPeriod) => void;\n  discountLabel?: string;\n  accent?: string;\n}\n\nconst defaultPlans: PricingToggleBurstPlan[] = [\n  {\n    name: \"Starter\",\n    tagline: \"For solo builders validating an idea.\",\n    monthly: 19,\n    yearly: 15,\n    features: [\"2 production apps\", \"50k function runs\", \"Daily backups\", \"Community forum\"],\n    cta: { label: \"Start building\", href: \"#\" },\n  },\n  {\n    name: \"Studio\",\n    tagline: \"For small teams shipping every week.\",\n    monthly: 49,\n    yearly: 39,\n    features: [\"Unlimited apps\", \"1M function runs\", \"Branch previews\", \"Role-based access\", \"Priority email support\"],\n    cta: { label: \"Start 14-day trial\", href: \"#\" },\n    featured: true,\n  },\n  {\n    name: \"Scale\",\n    tagline: \"For products with real traffic and SLAs.\",\n    monthly: 149,\n    yearly: 119,\n    features: [\"Everything in Studio\", \"10M function runs\", \"SAML SSO\", \"99.99% uptime SLA\", \"Dedicated success manager\"],\n    cta: { label: \"Contact sales\", href: \"#\" },\n  },\n];\n\nconst shards = Array.from({ length: 16 }, (_, i) => {\n  const h = (Math.imul(i + 7, 2654435761) >>> 0) % 1000;\n  const angle = (i / 16) * 360 + (h % 22) - 11;\n  const dist = 34 + (h % 30);\n  const size = 4 + (h % 4);\n  return { angle: angle.toFixed(1), dist: dist.toFixed(1), size, round: h % 3 === 0, delay: ((h % 60) / 1000).toFixed(3) };\n});\n\nconst css = `\n.hb-vh1 {\n  --hb-vh1-accent: #2f7bff;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  isolation: isolate;\n  overflow: hidden;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vh1 *, .hb-vh1 *::before, .hb-vh1 *::after { box-sizing: border-box; }\n.hb-vh1::before {\n  content: \"\";\n  position: absolute;\n  inset: -20% 10% auto;\n  height: 520px;\n  z-index: -1;\n  background: radial-gradient(50% 50% at 50% 0%, color-mix(in srgb, var(--hb-vh1-accent) 20%, transparent), transparent 70%);\n  pointer-events: none;\n}\n.hb-vh1-inner { max-width: 1080px; margin: 0 auto; padding: 72px 20px 72px; }\n.hb-vh1-head { display: flex; flex-direction: column; align-items: center; text-align: center; }\n.hb-vh1-eyebrow {\n  margin: 0 0 14px;\n  color: color-mix(in srgb, var(--hb-vh1-accent) 55%, #fff);\n  font-size: 13px;\n  font-weight: 600;\n  letter-spacing: .08em;\n  text-transform: uppercase;\n}\n.hb-vh1-title {\n  margin: 0;\n  max-width: 640px;\n  font-size: clamp(30px, 5cqi, 48px);\n  font-weight: 650;\n  line-height: 1.06;\n  letter-spacing: -.035em;\n  text-wrap: balance;\n}\n.hb-vh1-sub { margin: 14px 0 0; max-width: 520px; color: #8f8f8f; font-size: 16px; line-height: 1.6; text-wrap: pretty; }\n.hb-vh1-ctrl { position: relative; display: flex; align-items: center; gap: 14px; margin-top: 32px; }\n.hb-vh1-toggle {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  gap: 12px;\n  padding: 0;\n  border: 0;\n  background: none;\n  color: #8f8f8f;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 550;\n  cursor: pointer;\n}\n.hb-vh1-toggle span[data-on=\"true\"] { color: #fff; }\n.hb-vh1-toggle span { transition: color .3s ease; }\n.hb-vh1-track {\n  position: relative;\n  width: 52px;\n  height: 30px;\n  border-radius: 999px;\n  background: #1c1c1f;\n  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 2px 6px rgba(0, 0, 0, .6);\n  transition: background-color .35s ease, box-shadow .35s ease;\n}\n.hb-vh1-toggle[aria-checked=\"true\"] .hb-vh1-track {\n  background: var(--hb-vh1-accent);\n  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 0 22px -4px var(--hb-vh1-accent);\n}\n.hb-vh1-knob {\n  position: absolute;\n  top: 3px;\n  left: 3px;\n  width: 24px;\n  height: 24px;\n  border-radius: 999px;\n  background: linear-gradient(180deg, #fff, #dcdce2);\n  box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 -1px 0 rgba(0, 0, 0, .1);\n  transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), width .2s ease;\n}\n.hb-vh1-toggle:active .hb-vh1-knob { width: 30px; }\n.hb-vh1-toggle[aria-checked=\"true\"] .hb-vh1-knob { transform: translateX(22px); }\n.hb-vh1-toggle[aria-checked=\"true\"]:active .hb-vh1-knob { transform: translateX(16px); }\n.hb-vh1-toggle:focus-visible { outline: none; }\n.hb-vh1-toggle:focus-visible .hb-vh1-track { outline: 2px solid var(--hb-vh1-accent); outline-offset: 3px; }\n.hb-vh1-badge-wrap { position: relative; display: inline-flex; }\n.hb-vh1-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  height: 28px;\n  padding: 0 12px;\n  border: 1px dashed rgba(255, 255, 255, .16);\n  border-radius: 999px;\n  color: #8f8f8f;\n  font-size: 12.5px;\n  font-weight: 600;\n  white-space: nowrap;\n  transition: color .3s ease, border-color .3s ease, background-color .3s ease;\n}\n.hb-vh1-badge[data-on=\"true\"] {\n  border-style: solid;\n  border-color: color-mix(in srgb, var(--hb-vh1-accent) 60%, transparent);\n  background: color-mix(in srgb, var(--hb-vh1-accent) 18%, transparent);\n  color: #fff;\n  animation: hb-vh1-pop .6s cubic-bezier(.34, 1.8, .5, 1);\n}\n@keyframes hb-vh1-pop { 0% { transform: scale(1); } 35% { transform: scale(1.18) rotate(-3deg); } 100% { transform: scale(1); } }\n.hb-vh1-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }\n.hb-vh1-shard {\n  position: absolute;\n  left: 0;\n  top: 0;\n  background: var(--hb-vh1-accent);\n  opacity: 0;\n  animation: hb-vh1-fly .8s cubic-bezier(.12, .7, .3, 1) forwards;\n}\n.hb-vh1-shard:nth-child(3n) { background: #fff; }\n.hb-vh1-shard:nth-child(4n) { background: color-mix(in srgb, var(--hb-vh1-accent) 50%, #fff); }\n@keyframes hb-vh1-fly {\n  0% { opacity: 1; transform: rotate(var(--a)) translateX(4px) scale(1); }\n  70% { opacity: 1; }\n  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(.3); }\n}\n.hb-vh1-ring {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  width: 40px;\n  height: 40px;\n  margin: -20px 0 0 -20px;\n  border-radius: 999px;\n  border: 2px solid var(--hb-vh1-accent);\n  opacity: 0;\n  animation: hb-vh1-ring .7s cubic-bezier(.2, .7, .3, 1);\n}\n@keyframes hb-vh1-ring { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(2.6); } }\n.hb-vh1-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 44px 0 0; padding: 0; list-style: none; }\n@container (min-width: 760px) { .hb-vh1-grid { grid-template-columns: repeat(3, 1fr); } }\n.hb-vh1-card {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  padding: 26px 24px 24px;\n  border: 1px solid rgba(255, 255, 255, .08);\n  border-radius: 20px;\n  background: linear-gradient(180deg, #131315, #0e0e10);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);\n}\n.hb-vh1-card[data-featured=\"true\"] {\n  border-color: color-mix(in srgb, var(--hb-vh1-accent) 45%, transparent);\n  background:\n    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--hb-vh1-accent) 14%, transparent), transparent 70%),\n    linear-gradient(180deg, #141418, #0e0e11);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 24px 60px -30px color-mix(in srgb, var(--hb-vh1-accent) 70%, transparent);\n}\n.hb-vh1-name { margin: 0; font-size: 15px; font-weight: 600; }\n.hb-vh1-tag { margin: 6px 0 0; color: #8f8f8f; font-size: 13.5px; line-height: 1.5; }\n.hb-vh1-price { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 86px; margin-top: 18px; }\n.hb-vh1-was {\n  position: relative;\n  align-self: flex-start;\n  color: #6b6b6b;\n  font-size: 15px;\n  font-weight: 500;\n  font-variant-numeric: tabular-nums;\n  opacity: 0;\n  transform: translateY(6px);\n  transition: opacity .35s ease, transform .45s cubic-bezier(.2, .8, .2, 1);\n}\n.hb-vh1-was::after {\n  content: \"\";\n  position: absolute;\n  left: -2px;\n  right: -2px;\n  top: 52%;\n  height: 1.5px;\n  background: #ff6b6b;\n  transform: scaleX(0);\n  transform-origin: left;\n  transition: transform .4s cubic-bezier(.65, 0, .35, 1) .15s;\n}\n.hb-vh1[data-period=\"yearly\"] .hb-vh1-was { opacity: 1; transform: none; }\n.hb-vh1[data-period=\"yearly\"] .hb-vh1-was::after { transform: scaleX(1); }\n.hb-vh1-amount { display: flex; align-items: baseline; gap: 6px; height: 52px; overflow: hidden; }\n.hb-vh1-num {\n  display: inline-block;\n  font-size: 46px;\n  font-weight: 650;\n  letter-spacing: -.04em;\n  line-height: 52px;\n  font-variant-numeric: tabular-nums;\n  animation: hb-vh1-in .55s cubic-bezier(.2, .9, .25, 1.15);\n}\n@keyframes hb-vh1-in { 0% { opacity: 0; transform: translateY(70%); filter: blur(4px); } 100% { opacity: 1; transform: none; filter: blur(0); } }\n.hb-vh1-per { color: #8f8f8f; font-size: 13.5px; }\n.hb-vh1-save {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  align-self: flex-start;\n  height: 24px;\n  margin-top: 10px;\n  padding: 0 10px;\n  border-radius: 999px;\n  background: color-mix(in srgb, #3ddc97 14%, transparent);\n  color: #6ee7b7;\n  font-size: 12px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n  opacity: 0;\n  transform: translateY(-4px) scale(.94);\n  transition: opacity .35s ease .1s, transform .5s cubic-bezier(.34, 1.56, .64, 1) .1s;\n}\n.hb-vh1[data-period=\"yearly\"] .hb-vh1-save { opacity: 1; transform: none; }\n.hb-vh1-save[data-zero=\"true\"] { visibility: hidden; }\n.hb-vh1-cta {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  height: 42px;\n  margin-top: 18px;\n  border-radius: 12px;\n  border: 1px solid rgba(255, 255, 255, .12);\n  background: rgba(255, 255, 255, .03);\n  color: #ededed;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: background-color .2s ease, border-color .2s ease, transform .15s ease;\n}\n.hb-vh1-cta:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .2); }\n.hb-vh1-cta:active { transform: scale(.98); }\n.hb-vh1-cta:focus-visible { outline: 2px solid var(--hb-vh1-accent); outline-offset: 2px; }\n.hb-vh1-card[data-featured=\"true\"] .hb-vh1-cta {\n  border-color: transparent;\n  background: linear-gradient(180deg, color-mix(in srgb, var(--hb-vh1-accent) 85%, #fff), var(--hb-vh1-accent));\n  color: #fff;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 24px -10px var(--hb-vh1-accent);\n}\n.hb-vh1-card[data-featured=\"true\"] .hb-vh1-cta:hover { filter: brightness(1.08); }\n.hb-vh1-list { display: grid; gap: 10px; margin: 22px 0 0; padding: 20px 0 0; border-top: 1px solid rgba(255, 255, 255, .07); list-style: none; }\n.hb-vh1-list li { display: flex; gap: 10px; color: #b5b5b5; font-size: 13.5px; line-height: 1.4; }\n.hb-vh1-list svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--hb-vh1-accent); }\n@media (prefers-reduced-motion: reduce) {\n  .hb-vh1 *, .hb-vh1 *::before, .hb-vh1 *::after { animation: none !important; transition: none !important; }\n  .hb-vh1-burst { display: none; }\n}\n`;\n\nexport function PricingToggleBurst({\n  eyebrow = \"Pricing\",\n  title = \"Simple plans that pay for themselves\",\n  subtitle = \"Every plan includes unlimited collaborators and global edge hosting. Switch to yearly and keep two months on us.\",\n  plans = defaultPlans,\n  currency = \"USD\",\n  locale = \"en-US\",\n  period,\n  defaultPeriod = \"monthly\",\n  onPeriodChange,\n  discountLabel = \"2 months free\",\n  accent = \"#2f7bff\",\n  className = \"\",\n  style,\n  ...rest\n}: PricingToggleBurstProps) {\n  const [inner, setInner] = React.useState<PricingToggleBurstPeriod>(defaultPeriod);\n  const [burst, setBurst] = React.useState(0);\n  const current = period ?? inner;\n  const yearly = current === \"yearly\";\n\n  const money = React.useMemo(\n    () => new Intl.NumberFormat(locale, { style: \"currency\", currency, maximumFractionDigits: 0 }),\n    [locale, currency],\n  );\n\n  const toggle = () => {\n    const next: PricingToggleBurstPeriod = yearly ? \"monthly\" : \"yearly\";\n    if (period === undefined) setInner(next);\n    if (next === \"yearly\") setBurst((b) => b + 1);\n    onPeriodChange?.(next);\n  };\n\n  return (\n    <section\n      className={`hb-vh1 ${className}`}\n      data-period={current}\n      style={{ \"--hb-vh1-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-pricing-toggle-burst\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vh1-inner\">\n        <div className=\"hb-vh1-head\">\n          {eyebrow ? <p className=\"hb-vh1-eyebrow\">{eyebrow}</p> : null}\n          <h2 className=\"hb-vh1-title\">{title}</h2>\n          {subtitle ? <p className=\"hb-vh1-sub\">{subtitle}</p> : null}\n          <div className=\"hb-vh1-ctrl\">\n            <button type=\"button\" role=\"switch\" aria-checked={yearly} aria-label=\"Bill yearly\" className=\"hb-vh1-toggle\" onClick={toggle}>\n              <span data-on={!yearly}>Monthly</span>\n              <span className=\"hb-vh1-track\" aria-hidden=\"true\">\n                <span className=\"hb-vh1-knob\" />\n              </span>\n              <span data-on={yearly}>Yearly</span>\n            </button>\n            {discountLabel ? (\n              <span className=\"hb-vh1-badge-wrap\">\n                <span key={`b${burst}`} className=\"hb-vh1-badge\" data-on={yearly}>\n                  <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\">\n                    <path d=\"M8 1.5l1.6 3.6 3.9.4-2.9 2.6.8 3.8L8 10l-3.4 1.9.8-3.8L2.5 5.5l3.9-.4z\" fill=\"currentColor\" />\n                  </svg>\n                  {discountLabel}\n                </span>\n                {burst > 0 ? (\n                  <span key={burst} className=\"hb-vh1-burst\" aria-hidden=\"true\">\n                    <span className=\"hb-vh1-ring\" />\n                    {shards.map((s, i) => (\n                      <span\n                        key={i}\n                        className=\"hb-vh1-shard\"\n                        style={{\n                          width: s.size,\n                          height: s.round ? s.size : 2,\n                          borderRadius: s.round ? 999 : 1,\n                          animationDelay: `${s.delay}s`,\n                          \"--a\": `${s.angle}deg`,\n                          \"--d\": `${s.dist}px`,\n                        } as React.CSSProperties}\n                      />\n                    ))}\n                  </span>\n                ) : null}\n              </span>\n            ) : null}\n          </div>\n        </div>\n        <ul className=\"hb-vh1-grid\">\n          {plans.map((plan) => {\n            const value = yearly ? plan.yearly : plan.monthly;\n            const saved = (plan.monthly - plan.yearly) * 12;\n            return (\n              <li key={plan.name} className=\"hb-vh1-card\" data-featured={plan.featured ? \"true\" : undefined}>\n                <h3 className=\"hb-vh1-name\">{plan.name}</h3>\n                <p className=\"hb-vh1-tag\">{plan.tagline}</p>\n                <div className=\"hb-vh1-price\">\n                  <span className=\"hb-vh1-was\" aria-hidden={!yearly}>{money.format(plan.monthly)}</span>\n                  <div className=\"hb-vh1-amount\" aria-live=\"polite\">\n                    <span key={`${current}-${value}`} className=\"hb-vh1-num\">{money.format(value)}</span>\n                    <span className=\"hb-vh1-per\">/ month</span>\n                  </div>\n                </div>\n                <span className=\"hb-vh1-save\" data-zero={saved <= 0 ? \"true\" : undefined}>\n                  You save {money.format(saved)} a year\n                </span>\n                <a className=\"hb-vh1-cta\" href={plan.cta.href}>{plan.cta.label}</a>\n                <ul className=\"hb-vh1-list\">\n                  {plan.features.map((f) => (\n                    <li key={f}>\n                      <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                        <path d=\"M3.5 8.5l3 3 6-7\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                      </svg>\n                      {f}\n                    </li>\n                  ))}\n                </ul>\n              </li>\n            );\n          })}\n        </ul>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}