{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"pricing-section","type":"registry:block","title":"Pricing","description":"Pricing table with a volt billing toggle, a seat slider with volume-discount tiers and plan prices that roll digit by digit whenever billing or seats change; the featured plan glows.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":["@geturui/badge","@geturui/button","@geturui/number-ticker","@geturui/range-slider","@geturui/tabs"],"files":[{"path":"registry/geturui/blocks/pricing-section.tsx","type":"registry:block","target":"components/blocks/pricing-section.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { Check, Minus } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { NumberTicker } from \"@/components/ui/number-ticker\";\nimport { RangeSlider } from \"@/components/ui/range-slider\";\nimport { Tabs } from \"@/components/ui/tabs\";\n\nexport type Billing = \"monthly\" | \"yearly\";\n\nexport interface PricingFeature {\n  label: string;\n  /** false renders a dash; a string renders as a detail after the label. */\n  included: boolean | string;\n}\n\nexport interface PricingPlan {\n  id: string;\n  name: string;\n  description: string;\n  /** Per-seat price per month when billed monthly. */\n  monthly: number;\n  /** Per-seat price per month when billed yearly. */\n  yearly: number;\n  features: PricingFeature[];\n  cta?: string;\n  /** Highlight with the volt glow and a badge. */\n  featured?: boolean;\n  badge?: string;\n}\n\nexport interface SeatTier {\n  /** First seat count this tier applies to. */\n  from: number;\n  /** Fraction off, 0–1. */\n  discount: number;\n}\n\nexport interface PlanSelection {\n  planId: string;\n  billing: Billing;\n  seats: number;\n  /** Monthly total after the seat discount. */\n  total: number;\n}\n\nexport interface PricingSectionProps {\n  eyebrow?: string;\n  heading?: string;\n  subheading?: string;\n  plans?: PricingPlan[];\n  billing?: Billing;\n  defaultBilling?: Billing;\n  onBillingChange?: (billing: Billing) => void;\n  minSeats?: number;\n  maxSeats?: number;\n  defaultSeats?: number;\n  /** Volume discounts, ascending by `from`. Pass [] to hide the seat slider. */\n  tiers?: SeatTier[];\n  /** Label on the yearly tab, e.g. \"Save 20%\". */\n  yearlyNote?: string;\n  currency?: string;\n  onSelectPlan?: (selection: PlanSelection) => void;\n  className?: string;\n}\n\nconst DEFAULT_PLANS: PricingPlan[] = [\n  {\n    id: \"starter\",\n    name: \"Starter\",\n    description: \"For small teams putting their first polished product out.\",\n    monthly: 12,\n    yearly: 10,\n    cta: \"Start with Starter\",\n    features: [\n      { label: \"All free components\", included: true },\n      { label: \"Pro blocks\", included: \"20 / month\" },\n      { label: \"Figma-ready tokens\", included: true },\n      { label: \"Private registry\", included: false },\n      { label: \"Priority support\", included: false },\n    ],\n  },\n  {\n    id: \"team\",\n    name: \"Team\",\n    description: \"Every Pro block, a private registry and help when you need it.\",\n    monthly: 24,\n    yearly: 19,\n    cta: \"Choose Team\",\n    featured: true,\n    badge: \"Most popular\",\n    features: [\n      { label: \"All free components\", included: true },\n      { label: \"Pro blocks\", included: \"Unlimited\" },\n      { label: \"Figma-ready tokens\", included: true },\n      { label: \"Private registry\", included: true },\n      { label: \"Priority support\", included: \"4h reply\" },\n    ],\n  },\n];\n\nconst DEFAULT_TIERS: SeatTier[] = [\n  { from: 1, discount: 0 },\n  { from: 10, discount: 0.1 },\n  { from: 25, discount: 0.15 },\n  { from: 40, discount: 0.2 },\n];\n\nfunction tierFor(tiers: SeatTier[], seats: number) {\n  let found: SeatTier | undefined;\n  for (const t of tiers) if (seats >= t.from) found = t;\n  return found;\n}\n\n/** Pricing table: volt billing toggle, seat slider with volume tiers, and plan prices that roll digit by digit as inputs change. */\nexport function PricingSection({\n  eyebrow = \"Pricing\",\n  heading = \"Pay per seat, save as you grow\",\n  subheading = \"Every plan includes lifetime access to the free library. Switch or cancel any time.\",\n  plans = DEFAULT_PLANS,\n  billing,\n  defaultBilling = \"yearly\",\n  onBillingChange,\n  minSeats = 1,\n  maxSeats = 50,\n  defaultSeats = 8,\n  tiers = DEFAULT_TIERS,\n  yearlyNote = \"Save 20%\",\n  currency = \"$\",\n  onSelectPlan,\n  className,\n}: PricingSectionProps) {\n  const [innerBilling, setInnerBilling] = React.useState<Billing>(defaultBilling);\n  const cycle = billing ?? innerBilling;\n  const [seats, setSeats] = React.useState(defaultSeats);\n  const showSeats = tiers.length > 0;\n  const effectiveSeats = showSeats ? seats : 1;\n  const tier = tierFor(tiers, effectiveSeats);\n  const discount = tier?.discount ?? 0;\n  const tierGroup = React.useId();\n\n  function changeBilling(v: string) {\n    const next = v as Billing;\n    if (billing === undefined) setInnerBilling(next);\n    onBillingChange?.(next);\n  }\n\n  return (\n    <section className={cn(\"@container w-full px-4 py-16 sm:px-6 sm:py-24\", className)}>\n      <div className=\"mx-auto grid max-w-5xl gap-10\">\n        <header className=\"mx-auto grid max-w-2xl justify-items-center gap-3 text-center\">\n          {eyebrow && <span className=\"text-[13px] font-semibold uppercase tracking-[1px] text-volt-ink\">{eyebrow}</span>}\n          <h2 className=\"text-balance font-display text-3xl font-semibold tracking-[-0.8px] text-ink @xl:text-[40px] @xl:leading-[1.1]\">{heading}</h2>\n          {subheading && <p className=\"text-balance text-base leading-7 text-ink-muted\">{subheading}</p>}\n          <Tabs\n            variant=\"volt\"\n            aria-label=\"Billing period\"\n            className=\"mt-3\"\n            value={cycle}\n            onValueChange={changeBilling}\n            items={[\n              { value: \"monthly\", label: \"Monthly\" },\n              {\n                value: \"yearly\",\n                label: (\n                  <>\n                    Yearly\n                    {yearlyNote && (\n                      <span className={cn(\"rounded-full px-1.5 text-[10.5px] font-semibold\", cycle === \"yearly\" ? \"bg-on-volt/15\" : \"bg-volt-soft text-volt-ink\")}>\n                        {yearlyNote}\n                      </span>\n                    )}\n                  </>\n                ),\n              },\n            ]}\n          />\n        </header>\n\n        {showSeats && (\n          <div className=\"mx-auto grid w-full max-w-xl gap-4 rounded-lg border border-border bg-surface p-5\">\n            <RangeSlider\n              label=\"Team size\"\n              min={minSeats}\n              max={maxSeats}\n              value={seats}\n              onValueChange={setSeats}\n              format={(v) => `${v} ${v === 1 ? \"seat\" : \"seats\"}`}\n            />\n            <div className=\"flex flex-wrap gap-1.5\" role=\"list\" aria-label=\"Volume discounts\">\n              {tiers.map((t, i) => {\n                const next = tiers[i + 1];\n                const on = tier === t;\n                const range = next ? `${t.from}–${next.from - 1}` : `${t.from}+`;\n                return (\n                  <span\n                    key={t.from}\n                    role=\"listitem\"\n                    aria-current={on || undefined}\n                    className={cn(\n                      \"relative inline-flex h-7 items-center rounded-full px-3 text-[12px] font-medium transition-colors duration-200\",\n                      on ? \"text-volt-ink\" : \"text-ink-subtle\",\n                    )}\n                  >\n                    {on && (\n                      <motion.span\n                        layoutId={`tier-${tierGroup}`}\n                        className=\"absolute inset-0 rounded-full bg-volt-soft ring-1 ring-inset ring-volt-ink/40\"\n                        transition={{ type: \"spring\", stiffness: 420, damping: 32 }}\n                      />\n                    )}\n                    <span className=\"relative\">\n                      {range} seats{t.discount > 0 ? ` · ${Math.round(t.discount * 100)}% off` : \"\"}\n                    </span>\n                  </span>\n                );\n              })}\n            </div>\n          </div>\n        )}\n\n        <div className={cn(\"grid gap-4\", plans.length >= 3 ? \"@2xl:grid-cols-2 @4xl:grid-cols-3\" : \"@2xl:grid-cols-2\")}>\n          {plans.map((plan) => {\n            const perSeat = cycle === \"yearly\" ? plan.yearly : plan.monthly;\n            const total = Math.round(perSeat * effectiveSeats * (1 - discount));\n            return (\n              <motion.article\n                key={plan.id}\n                layout\n                transition={{ type: \"spring\", stiffness: 300, damping: 30 }}\n                className={cn(\n                  \"relative flex flex-col gap-6 rounded-xl border p-6 @xl:p-7\",\n                  plan.featured ? \"border-volt-ink/60 bg-surface-raised shadow-glow\" : \"border-border bg-surface\",\n                )}\n              >\n                <div className=\"grid gap-2\">\n                  <div className=\"flex items-center justify-between gap-3\">\n                    <h3 className=\"font-display text-xl font-semibold tracking-[-0.3px] text-ink\">{plan.name}</h3>\n                    {plan.featured && plan.badge && <Badge tone=\"new\">{plan.badge}</Badge>}\n                  </div>\n                  <p className=\"text-sm leading-[22px] text-ink-muted\">{plan.description}</p>\n                </div>\n\n                <div className=\"grid gap-1.5\">\n                  <div className=\"flex items-baseline gap-1.5\">\n                    <NumberTicker\n                      value={total}\n                      prefix={currency}\n                      className=\"font-display text-[44px] font-semibold tracking-[-1.4px] text-ink\"\n                    />\n                    <span className=\"text-sm text-ink-muted\">/ month</span>\n                  </div>\n                  <div className=\"relative h-5 text-[13px] text-ink-subtle\">\n                    <AnimatePresence mode=\"popLayout\" initial={false}>\n                      <motion.span\n                        key={`${cycle}-${effectiveSeats}`}\n                        className=\"absolute inset-x-0 top-0 truncate\"\n                        initial={{ opacity: 0, y: 6, filter: \"blur(8px)\" }}\n                        animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n                        exit={{ opacity: 0, y: -6, filter: \"blur(8px)\" }}\n                        transition={{ duration: 0.25 }}\n                      >\n                        {currency}\n                        {perSeat} per seat\n                        {showSeats ? ` × ${effectiveSeats}` : \"\"}\n                        {cycle === \"yearly\" ? ` · billed ${currency}${(total * 12).toLocaleString(\"en-US\")} yearly` : \" · billed monthly\"}\n                      </motion.span>\n                    </AnimatePresence>\n                  </div>\n                </div>\n\n                <Button\n                  block\n                  size=\"lg\"\n                  variant={plan.featured ? \"primary\" : \"secondary\"}\n                  trailing=\"arrow\"\n                  onClick={() => onSelectPlan?.({ planId: plan.id, billing: cycle, seats: effectiveSeats, total })}\n                >\n                  {plan.cta ?? `Choose ${plan.name}`}\n                </Button>\n\n                <ul className=\"grid gap-3 border-t border-border pt-6\">\n                  {plan.features.map((f) => {\n                    const on = f.included !== false;\n                    return (\n                      <li key={f.label} className={cn(\"flex items-start gap-3 text-sm leading-5\", on ? \"text-ink\" : \"text-ink-subtle\")}>\n                        {on ? (\n                          <span className=\"mt-px grid size-[18px] shrink-0 place-items-center rounded-full bg-volt-soft text-volt-ink\">\n                            <Check className=\"size-3\" strokeWidth={3} aria-hidden />\n                          </span>\n                        ) : (\n                          <span className=\"mt-px grid size-[18px] shrink-0 place-items-center rounded-full bg-surface-sunken text-ink-subtle\">\n                            <Minus className=\"size-3\" strokeWidth={3} aria-hidden />\n                          </span>\n                        )}\n                        <span className=\"flex-1\">\n                          <span className=\"sr-only\">{on ? \"Included: \" : \"Not included: \"}</span>\n                          {f.label}\n                          {typeof f.included === \"string\" && <span className=\"ml-1.5 text-ink-muted\">· {f.included}</span>}\n                        </span>\n                      </li>\n                    );\n                  })}\n                </ul>\n              </motion.article>\n            );\n          })}\n        </div>\n      </div>\n    </section>\n  );\n}\n"},{"path":"LICENSE-geturui.md","type":"registry:file","target":"LICENSE-geturui.md","content":"MIT License\n\nCopyright (c) 2026 geturui.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"}],"categories":["blocks","pricing","plans","billing","toggle","slider","seats","saas"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/pricing-section"}}