{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-toggle",
  "title": "Pricing Toggle",
  "description": "Monthly / yearly switch with odometer prices. Drag halfway and prices sit halfway; land on yearly and the badge peels, the old price strikes through.",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "src/components/pricing-toggle/pricing-toggle.tsx",
      "content": "// Brio UI · pricing-toggle · MIT License · Copyright (c) 2026 Harjot Singh Rana · https://brioui.com/docs/components/pricing-toggle\n'use client'\n/*\n * Reduced-motion preference, hydration-safe: the server and the hydrating render both read\n * `false`, then React re-renders with the real value, so server HTML and the first client\n * render always agree.\n */\nconst REDUCED_QUERY = '(prefers-reduced-motion: reduce)'\nfunction subscribeReduced(onChange: () => void) {\n  const mq = window.matchMedia(REDUCED_QUERY)\n  mq.addEventListener('change', onChange)\n  return () => mq.removeEventListener('change', onChange)\n}\nconst getReduced = () => window.matchMedia(REDUCED_QUERY).matches\nconst getServerReduced = () => false\n\n/**\n * Pricing Toggle — the monthly / yearly switch, with prices that roll.\n *\n * Composable pieces that share one billing period:\n *   <Billing>            provider (controlled or uncontrolled), renders no DOM\n *   <BillingSwitch>      segmented switch; click, arrow keys, or drag the thumb\n *   <BillingPrice>       odometer price, locale-formatted, per-digit springs\n *   <BillingText>        any line that differs per period (\"billed yearly\")\n *   useBilling()         { period, setPeriod }\n *\n * Prop types are exported as BillingProps, BillingSwitchProps,\n * BillingPriceProps and BillingTextProps.\n *\n * Drag the thumb halfway and every price on the page sits halfway between\n * monthly and yearly, digits mid-roll. Let go and it snaps with your throw.\n * Land on yearly and the savings badge peels up and sticks back down; the\n * old monthly price appears struck through beside the new one.\n *\n * Accessible: the switch is a radiogroup (arrow keys wrap, roving tabindex); each\n * price exposes its final formatted value once, never digit soup. Reduced\n * motion: digits and thumb jump, text crossfades.\n *\n * Controlled: pass `period` + `onChange`. The thumb and prices always follow\n * the `period` you hold: if you keep the old one (say, yearly is gated), a\n * drag or click springs back instead of leaving the switch on the new side.\n *\n * Locale: <BillingPrice> formats with the visitor's locale by default. When\n * rendering on the server (SSR / RSC), pass `locale` (and `currency`)\n * explicitly, or the server's locale can differ from the browser's and the\n * price will mismatch on hydration.\n *\n * Corners follow --ui-radius-pill (see Theming → Corners).\n * Theme via library tokens (--ui-ink, --ui-surface, --ui-accent) or\n * --pricing-toggle-* overrides.\n *\n * Requires: react >= 19, motion >= 11.\n */\nimport {\n  AnimatePresence,\n  animate,\n  motion,\n  useMotionValue,\n  type MotionValue,\n  type Variants,\n} from 'motion/react'\nimport {\n  createContext,\n  createElement,\n  memo,\n  useCallback,\n  useContext,\n  useEffect,\n  useMemo,\n  useRef,\n  useState,\n  useSyncExternalStore,\n  type CSSProperties,\n  type KeyboardEvent,\n  type PointerEvent as ReactPointerEvent,\n  type ReactNode,\n} from 'react'\n\n/* Icons: Iconoir (MIT, © 2021 Luca Burgio, iconoir.com), inlined so the component stays dependency-free. */\nconst UI_ICONS = {\n  'sparks': [['path', { d: 'M8 15C12.8747 15 15 12.949 15 8C15 12.949 17.1104 15 22 15C17.1104 15 15 17.1104 15 22C15 17.1104 12.8747 15 8 15Z' }], ['path', { d: 'M2 6.5C5.13376 6.5 6.5 5.18153 6.5 2C6.5 5.18153 7.85669 6.5 11 6.5C7.85669 6.5 6.5 7.85669 6.5 11C6.5 7.85669 5.13376 6.5 2 6.5Z' }]],\n} as const satisfies Record<string, readonly (readonly [string, Record<string, string>])[]>\n\ntype UiIconName = keyof typeof UI_ICONS\n\nfunction UiIcon({ name, size = 16, className }: { name: UiIconName; size?: number; className?: string }) {\n  return (\n    <svg className={['ui-icon', className].filter(Boolean).join(' ')} viewBox=\"0 0 24 24\" width={size} height={size} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.6} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      {UI_ICONS[name].map(([tag, attrs], i) => createElement(tag, { key: i, ...attrs }))}\n    </svg>\n  )\n}\n\n/* ────────────────────────────────────────────────────────────────────────── */\n/* Shared billing period                                                     */\n/* ────────────────────────────────────────────────────────────────────────── */\n\n/** The two billing periods every piece switches between. */\nexport type BillingPeriod = 'monthly' | 'yearly'\n\ntype BillingContextValue = {\n  period: BillingPeriod\n  /** 0 = monthly, 1 = yearly; follows drags and springs in between. */\n  progress: MotionValue<number>\n  go: (period: BillingPeriod, velocity?: number) => void\n  reduced: boolean\n}\n\n/* order of the switch's options, for arrow-key navigation */\nconst PERIODS: readonly BillingPeriod[] = ['monthly', 'yearly']\n\nconst BillingContext = createContext<BillingContextValue | null>(null)\n\nconst EASE_OUT = [0.23, 1, 0.32, 1] as const\nconst SNAP = { type: 'spring' as const, visualDuration: 0.5, bounce: 0.16 }\n\n/** Bundler-agnostic dev check: only a literal production NODE_ENV silences warnings. */\nconst isDev = () => (globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env?.NODE_ENV !== 'production'\nconst warned = new Set<string>()\nfunction devWarn(message: string) {\n  if (!isDev() || warned.has(message)) return\n  warned.add(message)\n  console.warn(message)\n}\n\n/** An ellipsized one-line text gets its full text as a tooltip, set on hover so text that fits stays quiet. */\nconst tipIfClipped = (e: { currentTarget: HTMLElement }) => {\n  const el = e.currentTarget\n  if (el.scrollWidth > el.clientWidth + 1) el.title = el.textContent ?? ''\n  else el.removeAttribute('title')\n}\n\n/*\n * Per-letter animation splits by grapheme (emoji and combining sequences stay whole). Scripts that\n * need shaping or run right to left (Arabic, Hebrew, Indic, Thai…) animate as a whole word:\n * splitting them would break the letterforms.\n */\nconst SHAPED = /[\\u0590-\\u08FF\\u0900-\\u0DFF\\u0E00-\\u0FFF\\u1000-\\u109F\\u1780-\\u18AF\\uA8E0-\\uA8FF\\uFB1D-\\uFDFF\\uFE70-\\uFEFF]/\nlet segmenter: { segment: (s: string) => Iterable<{ segment: string }> } | null | undefined\nfunction glyphsOf(text: string): string[] {\n  if (SHAPED.test(text)) return [text]\n  if (segmenter === undefined) {\n    try {\n      segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' })\n    } catch {\n      segmenter = null\n    }\n  }\n  return segmenter ? Array.from(segmenter.segment(text), g => g.segment) : Array.from(text)\n}\n\nfunction useBillingContext(name: string) {\n  const ctx = useContext(BillingContext)\n  if (!ctx) throw new Error(`<${name}> must be inside <Billing>.`)\n  return ctx\n}\n\n/** Props of `<Billing>`. */\nexport type BillingProps = {\n  /**\n   * The switch, prices and text that share this period. Any other markup can sit in between.\n   * Content that contains the switch, prices and text.\n   */\n  children: ReactNode\n  /** Controlled period. When set, the thumb and prices only move to the value you pass back. */\n  period?: BillingPeriod\n  /**\n   * Starting period when uncontrolled.\n   * @default 'monthly'\n   */\n  defaultPeriod?: BillingPeriod\n  /**\n   * Called when a click, key, drag or `setPeriod` asks for a different period than the current one.\n   */\n  onChange?: (period: BillingPeriod) => void\n}\n\n/**\n * Provider that holds the billing period for every `BillingSwitch`,\n * `BillingPrice` and `BillingText` inside it. Renders no DOM of its own.\n */\nexport function Billing({ children, period, defaultPeriod = 'monthly', onChange }: BillingProps) {\n  const reduced = useSyncExternalStore(subscribeReduced, getReduced, getServerReduced)\n  const [inner, setInner] = useState<BillingPeriod>(defaultPeriod)\n  const current = period ?? inner\n  const progress = useMotionValue(current === 'yearly' ? 1 : 0)\n  const target = useRef<BillingPeriod>(current)\n  const onChangeRef = useRef(onChange)\n  useEffect(() => {\n    onChangeRef.current = onChange\n  })\n\n  const glide = useCallback(\n    (p: BillingPeriod, velocity = 0) => {\n      target.current = p\n      const to = p === 'yearly' ? 1 : 0\n      if (reduced) progress.set(to)\n      else animate(progress, to, { ...SNAP, velocity })\n    },\n    [progress, reduced],\n  )\n\n  /* controlled: a request waiting for the parent's answer (carries the throw) */\n  const pending = useRef<{ velocity: number } | null>(null)\n  const [settle, setSettle] = useState(0)\n\n  const go = useCallback(\n    (p: BillingPeriod, velocity = 0) => {\n      if (period === undefined) {\n        glide(p, velocity)\n        setInner(p)\n      } else {\n        // don't move on our own: re-render and glide to whatever `period` the parent keeps\n        pending.current = { velocity }\n        setSettle(n => n + 1)\n      }\n      if (p !== current) onChangeRef.current?.(p)\n    },\n    [glide, period, current],\n  )\n\n  /* follow the period we're given; after a rejected drag/click this snaps back */\n  useEffect(() => {\n    const req = pending.current\n    pending.current = null\n    if (req || target.current !== current) glide(current, req?.velocity ?? 0)\n  }, [current, settle, glide])\n\n  const value = useMemo(() => ({ period: current, progress, go, reduced }), [current, progress, go, reduced])\n  return <BillingContext.Provider value={value}>{children}</BillingContext.Provider>\n}\n\n/**\n * Read and set the shared period from any component inside `<Billing>`.\n * Throws when used outside it.\n */\n// oxlint-disable-next-line react/only-export-components -- the hook belongs with its provider in this one file\nexport function useBilling() {\n  const ctx = useBillingContext('useBilling')\n  return { period: ctx.period, setPeriod: (p: BillingPeriod) => ctx.go(p) }\n}\n\n/* ────────────────────────────────────────────────────────────────────────── */\n/* Switch                                                                    */\n/* ────────────────────────────────────────────────────────────────────────── */\n\n/** Props of `<BillingSwitch>`. */\nexport type BillingSwitchProps = {\n  /**\n   * Text of the two segments. Both keys are required when you pass it.\n   *\n   * @default { monthly: 'Monthly', yearly: 'Yearly' }\n   */\n  labels?: Record<BillingPeriod, string>\n  /**\n   * Badge on the yearly segment. Pass `null` to hide it. At most 16em on one line; when the switch\n   * doesn't fit its container it wraps (see Layout notes) instead of cutting the badge. Shown on\n   * the yearly side.\n   *\n   * @default 'Save 20%'\n   */\n  badge?: ReactNode\n  /**\n   * Accessible name of the radiogroup.\n   * @default 'Billing period'\n   */\n  label?: string\n  /** Extra class on the track (`.bs-root`). */\n  className?: string\n  /** Inline styles on the track. */\n  style?: CSSProperties\n}\n\n/**\n * Two-option segmented switch (a radiogroup). Click a side, use the arrow\n * keys (Right/Down next, Left/Up previous, wrapping; Home/End first/last),\n * or drag the thumb; prices follow the thumb while it moves.\n * Must be inside `<Billing>`.\n */\nexport function BillingSwitch({\n  labels = { monthly: 'Monthly', yearly: 'Yearly' },\n  badge = 'Save 20%',\n  label = 'Billing period',\n  className,\n  style,\n}: BillingSwitchProps) {\n  const { period, progress, go, reduced } = useBillingContext('BillingSwitch')\n  const trackRef = useRef<HTMLDivElement>(null)\n  const segRefs = useRef<Record<BillingPeriod, HTMLButtonElement | null>>({ monthly: null, yearly: null })\n  const geo = useRef({ l0: 4, w0: 80, l1: 88, w1: 120 })\n  const thumbX = useMotionValue(4)\n  const thumbW = useMotionValue(80)\n  const drag = useRef<{ x: number; p: number; moved: boolean; id: number } | null>(null)\n  const suppressClick = useRef(false)\n  const [peel, setPeel] = useState(0)\n  /** mirrors data-wrap: a wrapped badge is a tall block, so its peel is a small nudge, not a flip */\n  const [wrapped, setWrapped] = useState(false)\n  const lastPeriod = useRef(period)\n\n  /* thumb follows progress; stretches with speed */\n  useEffect(() => {\n    const paint = () => {\n      const { l0, w0, l1, w1 } = geo.current\n      const p = progress.get()\n      const stretch = reduced ? 0 : Math.min(Math.abs(progress.getVelocity()) * 5, 16)\n      thumbW.set(w0 + (w1 - w0) * p + stretch)\n      thumbX.set(l0 + (l1 - l0) * p - stretch / 2)\n    }\n    const measure = () => {\n      const a = segRefs.current.monthly\n      const b = segRefs.current.yearly\n      if (!a || !b) return\n      geo.current = { l0: a.offsetLeft, w0: a.offsetWidth, l1: b.offsetLeft, w1: b.offsetWidth }\n      paint()\n    }\n    measure()\n    const off = progress.on('change', paint)\n    const ro = new ResizeObserver(measure)\n    if (trackRef.current) ro.observe(trackRef.current)\n    // the segments too: wrapping (data-wrap) can resize them without resizing the track\n    for (const el of Object.values(segRefs.current)) if (el) ro.observe(el)\n    return () => {\n      off()\n      ro.disconnect()\n    }\n  }, [progress, thumbX, thumbW, reduced])\n\n  /* when the labels or the badge don't fit on one line, the switch wraps instead of cutting text:\n     both segments share the width and their text breaks onto a second line (data-wrap). Checked in\n     the one-line layout, so it switches back as soon as there's room again. */\n  useEffect(() => {\n    const root = trackRef.current\n    if (!root) return\n    const fit = () => {\n      root.removeAttribute('data-wrap')\n      const clipped = [...root.querySelectorAll<HTMLElement>('.bs-label, .bs-badge')].some(el => el.scrollWidth > el.clientWidth + 1)\n      root.toggleAttribute('data-wrap', clipped)\n      setWrapped(clipped)\n    }\n    fit()\n    document.fonts?.ready.then(fit)\n    const ro = new ResizeObserver(fit)\n    ro.observe(root)\n    if (root.parentElement) ro.observe(root.parentElement)\n    return () => ro.disconnect()\n  }, [labels.monthly, labels.yearly, badge])\n\n  /* landing on yearly: the badge peels up and sticks back down */\n  useEffect(() => {\n    if (period === 'yearly' && lastPeriod.current !== 'yearly') setPeel(n => n + 1)\n    lastPeriod.current = period\n  }, [period])\n\n  const onDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n    if (e.button !== 0) return\n    drag.current = { x: e.clientX, p: progress.get(), moved: false, id: e.pointerId }\n    suppressClick.current = false\n  }\n  const onMove = (e: ReactPointerEvent<HTMLDivElement>) => {\n    const d = drag.current\n    if (!d) return\n    const dx = e.clientX - d.x\n    if (!d.moved) {\n      if (Math.abs(dx) < 4) return\n      d.moved = true\n      trackRef.current?.setPointerCapture(d.id)\n    }\n    // one \"span\" of pointer travel = the distance between the two segments' left edges = progress 0 → 1\n    const span = Math.max(1, geo.current.l1 - geo.current.l0)\n    progress.stop()\n    // a little rubber band past either end\n    const raw = d.p + dx / span\n    progress.set(raw < 0 ? raw * 0.25 : raw > 1 ? 1 + (raw - 1) * 0.25 : raw)\n  }\n  const onUp = () => {\n    const d = drag.current\n    drag.current = null\n    if (!d?.moved) return\n    suppressClick.current = true\n    const v = progress.getVelocity()\n    // project where the throw would land ~120 ms from now, so a quick flick counts even short of halfway\n    const projected = progress.get() + v * 0.12\n    go(projected > 0.5 ? 'yearly' : 'monthly', v)\n  }\n\n  /* radiogroup keys: Right/Down next, Left/Up previous (wrapping), Home/End first/last */\n  const onKey = (e: KeyboardEvent<HTMLDivElement>) => {\n    const step = e.key === 'ArrowRight' || e.key === 'ArrowDown' ? 1 : e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? -1 : 0\n    if (!step && e.key !== 'Home' && e.key !== 'End') return\n    e.preventDefault()\n    const focused = (e.target as HTMLElement).closest<HTMLElement>('[data-period]')?.dataset.period as BillingPeriod | undefined\n    const from = PERIODS.indexOf(focused ?? period)\n    const next: BillingPeriod =\n      e.key === 'Home' ? PERIODS[0] : e.key === 'End' ? PERIODS[PERIODS.length - 1] : PERIODS[(from + step + PERIODS.length) % PERIODS.length]\n    go(next)\n    segRefs.current[next]?.focus()\n  }\n\n  const seg = (p: BillingPeriod, children: ReactNode) => (\n    <button\n      ref={el => {\n        segRefs.current[p] = el\n      }}\n      type=\"button\"\n      role=\"radio\"\n      aria-checked={period === p}\n      tabIndex={period === p ? 0 : -1}\n      className=\"bs-seg\"\n      data-period={p}\n      onClick={() => {\n        if (suppressClick.current) {\n          suppressClick.current = false\n          return\n        }\n        go(p)\n      }}\n    >\n      {children}\n    </button>\n  )\n\n  return (\n    <motion.div\n      ref={trackRef}\n      role=\"radiogroup\"\n      aria-label={label}\n      className={['bs-root', className].filter(Boolean).join(' ')}\n      style={{ ...style, ['--p' as string]: progress } as never}\n      onPointerDown={onDown}\n      onPointerMove={onMove}\n      onPointerUp={onUp}\n      onPointerCancel={onUp}\n      onKeyDown={onKey}\n    >\n      <PricingStyles />\n      <motion.span className=\"bs-thumb\" aria-hidden style={{ x: thumbX, width: thumbW }} />\n      {seg('monthly', <span className=\"bs-label\" onPointerEnter={tipIfClipped}>{labels.monthly}</span>)}\n      {seg(\n        'yearly',\n        <>\n          <span className=\"bs-label\" onPointerEnter={tipIfClipped}>{labels.yearly}</span>\n          {badge != null && <span className=\"bp-sr\">, </span>}\n          {badge != null && (\n            <motion.span\n              key={peel}\n              className=\"bs-badge\"\n              initial={false}\n              animate={\n                peel && !reduced\n                  ? wrapped\n                    ? { rotate: [0, -2, 0.8, 0], y: [0, -3, 0.5, 0], scale: [1, 1.03, 0.995, 1] }\n                    : { rotate: [0, -10, 4, 0], y: [0, -6, 1, 0], scale: [1, 1.12, 0.98, 1] }\n                  : { rotate: 0, y: 0, scale: 1 }\n              }\n              transition={{ duration: 0.62, ease: EASE_OUT, times: [0, 0.35, 0.7, 1], delay: 0.08 }}\n              onPointerEnter={tipIfClipped}\n            >\n              <UiIcon name=\"sparks\" size={11} className=\"bs-badge-icon\" />\n              {badge}\n              {peel > 0 && !reduced && (\n                <motion.i\n                  className=\"bs-sheen\"\n                  aria-hidden\n                  // full-width layer with a narrow band: -100% → 100% carries the band clean across and out\n                  initial={{ x: '-100%' }}\n                  animate={{ x: '100%' }}\n                  transition={{ duration: 0.75, ease: [0.45, 0, 0.25, 1], delay: 0.3 }}\n                />\n              )}\n            </motion.span>\n          )}\n        </>,\n      )}\n    </motion.div>\n  )\n}\n\n/* ────────────────────────────────────────────────────────────────────────── */\n/* Price                                                                     */\n/* ────────────────────────────────────────────────────────────────────────── */\n\nconst LINE = 1.1 // em, digit line height\n\n/* memo: while the price rolls, only columns whose digit changed re-render */\nconst LATN = '0123456789'.split('')\n\n/* at rest a column holds one glyph; the strip (and its edge mask) only exists while it rolls */\nconst Digit = memo(function Digit({ d, place, reduced, glyphs = LATN }: { d: number; place: number; reduced: boolean; glyphs?: readonly string[] }) {\n  const [prev, setPrev] = useState(d)\n  const [from, setFrom] = useState<number | null>(null)\n  if (d !== prev) {\n    setPrev(d)\n    if (!reduced && from === null) setFrom(prev)\n  }\n  /* back to a still digit once the roll has settled (1 s after the last change covers the slowest spring) */\n  useEffect(() => {\n    if (from === null) return\n    const t = setTimeout(() => setFrom(null), 1000)\n    return () => clearTimeout(t)\n  }, [from, d])\n  return (\n    <motion.span\n      className=\"bp-col\"\n      data-rolling={from !== null || undefined}\n      initial={reduced ? false : { width: '0ch', opacity: 0 }}\n      animate={{ width: '1ch', opacity: 1 }}\n      exit={reduced ? { opacity: 0 } : { width: '0ch', opacity: 0 }}\n      transition={{ duration: 0.3, ease: EASE_OUT }}\n    >\n      {from === null ? (\n        <span className=\"bp-still\">{glyphs[d]}</span>\n      ) : (\n        <motion.span\n          className=\"bp-strip\"\n          initial={{ y: `${-from * LINE}em` }}\n          animate={{ y: `${-d * LINE}em` }}\n          // higher places are heavier: the roll cascades from the units upward\n          transition={{ type: 'spring', stiffness: Math.max(120, 300 - place * 45), damping: 24, mass: 0.8 }}\n        >\n          {glyphs.map((n, i) => (\n            <span key={i}>{n}</span>\n          ))}\n        </motion.span>\n      )}\n    </motion.span>\n  )\n})\n\n/** Props of `<BillingPrice>`. */\nexport type BillingPriceProps = {\n  /** Price shown on monthly. */\n  monthly: number\n  /**\n   * Price shown on yearly, in the same unit as `monthly` (usually the per-month equivalent, e.g.\n   * `9.6` next to `12`).\n   */\n  yearly: number\n  /**\n   * ISO 4217 code passed to `Intl.NumberFormat`. An invalid code (or locale) falls back to a plain\n   * number with a dev warning instead of throwing.\n   *\n   * @default 'USD'\n   */\n  currency?: string\n  /**\n   * BCP 47 locale for formatting. Set it when rendering on the server, or the server and browser\n   * can format differently and hydration will mismatch. Defaults to the runtime's locale; set it\n   * when rendering on the server.\n   *\n   * @default runtime locale\n   */\n  locale?: string\n  /**\n   * Defaults to 0 when both prices are whole numbers, else 2. Decimal places shown.\n   *\n   * @default `0` if both prices are whole numbers, else `2`\n   */\n  fractionDigits?: number\n  /**\n   * Text after the price, e.g. `'/mo'`, or one per period. Morphs word by word when it changes.\n   * \"/mo\", or per period: { monthly: '/mo', yearly: '/mo' }\n   */\n  suffix?: string | Record<BillingPeriod, string>\n  /**\n   * On yearly, show the monthly price struck through above the price. Only shown when `yearly <\n   * monthly`. When there is no room above the price (less than ~0.4em before the previous element),\n   * it sits beside the price instead so it never covers text.\n   *\n   * @default true\n   */\n  compare?: boolean\n  /**\n   * Extra class on `.bp-root`. Set `font-size` here; the suffix (0.36em) and old price (0.32em)\n   * scale from it.\n   */\n  className?: string\n  /** Inline styles on `.bp-root`. */\n  style?: CSSProperties\n}\n\n/**\n * Odometer price for the current period. Every digit rolls on its own spring,\n * and during a drag the value sits between `monthly` and `yearly`.\n * Rolls through the locale's own digits, keeps the number left-to-right in RTL\n * pages, shrinks to fit a narrow container, shows \"—\" for NaN / Infinity and a\n * plain number for an invalid currency (dev warnings).\n * Must be inside `<Billing>`.\n */\nexport function BillingPrice({\n  monthly,\n  yearly,\n  currency = 'USD',\n  locale,\n  fractionDigits,\n  suffix,\n  compare = true,\n  className,\n  style,\n}: BillingPriceProps) {\n  const { period, progress, reduced } = useBillingContext('BillingPrice')\n  /* NaN / Infinity never reach the screen: a missing price shows as a dash */\n  const m = Number.isFinite(monthly) ? monthly : null\n  const y = Number.isFinite(yearly) ? yearly : null\n  const fdRaw = fractionDigits ?? (Number.isInteger(m ?? 0) && Number.isInteger(y ?? 0) ? 0 : 2)\n  const fd = Number.isFinite(fdRaw) ? Math.min(20, Math.max(0, Math.round(fdRaw))) : 2\n  /* a malformed currency code or locale must not take the price down: fall back to a plain number */\n  const { fmt, bad } = useMemo(() => {\n    const opts = { minimumFractionDigits: fd, maximumFractionDigits: fd }\n    try {\n      return { fmt: new Intl.NumberFormat(locale, { ...opts, style: 'currency', currency }), bad: null }\n    } catch {\n      try {\n        return { fmt: new Intl.NumberFormat(locale, opts), bad: `currency \"${currency}\"` }\n      } catch {\n        return { fmt: new Intl.NumberFormat(undefined, opts), bad: `locale \"${locale}\" / currency \"${currency}\"` }\n      }\n    }\n  }, [locale, currency, fd])\n  /* the locale's own digits (Arabic-Indic, Devanagari…), so the odometer rolls through the right glyphs */\n  const glyphs = useMemo(() => {\n    const { locale: resolved, numberingSystem } = fmt.resolvedOptions()\n    if (numberingSystem === 'latn') return LATN\n    try {\n      const plain = new Intl.NumberFormat(resolved, { numberingSystem, useGrouping: false })\n      return LATN.map((_, i) => plain.format(i))\n    } catch {\n      return LATN\n    }\n  }, [fmt])\n  const nonFinite = m === null || y === null\n  useEffect(() => {\n    if (bad) devWarn(`BillingPrice: invalid ${bad}; showing a plain number.`)\n  }, [bad])\n  useEffect(() => {\n    if (nonFinite) devWarn('BillingPrice: `monthly` / `yearly` must be finite numbers; a missing price shows as \"—\".')\n  }, [nonFinite])\n  const round = useCallback((v: number) => Math.round(v * 10 ** fd) / 10 ** fd, [fd])\n  /* between the two prices while the thumb moves; with one price missing, jump at the halfway point */\n  const at = useCallback(\n    (p: number) => (m !== null && y !== null ? round(m + (y - m) * p) : p < 0.5 ? m : y),\n    [m, y, round],\n  )\n  const [value, setValue] = useState<number | null>(() => at(Math.min(1, Math.max(0, progress.get()))))\n\n  useEffect(() => {\n    // progress changes every frame of a drag/spring; only the rounded value is state,\n    // so React re-renders just when a shown digit actually changes\n    let last: number | null | undefined\n    const update = () => {\n      const next = at(Math.min(1, Math.max(0, progress.get())))\n      if (next === last) return\n      last = next\n      setValue(next)\n    }\n    update()\n    return progress.on('change', update)\n  }, [progress, at])\n\n  /* split into keyed parts: digits keyed by place so columns stay put; the number itself is one\n     left-to-right run, so right-to-left pages keep its digit order */\n  const parts = value === null ? [] : fmt.formatToParts(value)\n  const intDigits = parts.filter(p => p.type === 'integer').reduce((n, p) => n + p.value.length, 0)\n  const isNum = (t: string) => t === 'integer' || t === 'group' || t === 'decimal' || t === 'fraction'\n  const numberStart = parts.findIndex(p => isNum(p.type))\n  let numberEnd = -1\n  parts.forEach((p, i) => {\n    if (isNum(p.type)) numberEnd = i\n  })\n  let seenInt = 0\n  let seenFrac = 0\n  const seen: Record<string, number> = {}\n  type Node = { key: string; node: ReactNode; digit?: boolean }\n  const pre: Node[] = []\n  const num: Node[] = []\n  const post: Node[] = []\n  const digitNode = (ch: string, key: string, place: number): Node => {\n    const d = glyphs.indexOf(ch)\n    // a glyph outside the digit set (should not happen): show it as it is\n    return d < 0 ? { key, node: ch } : { key, digit: true, node: <Digit key={key} d={d} place={place} reduced={reduced} glyphs={glyphs} /> }\n  }\n  parts.forEach((part, idx) => {\n    const side = idx < numberStart ? pre : idx > numberEnd ? post : num\n    if (part.type === 'integer') {\n      for (const ch of Array.from(part.value)) {\n        const place = intDigits - 1 - seenInt++\n        side.push(digitNode(ch, `i${place}`, place))\n      }\n    } else if (part.type === 'fraction') {\n      for (const ch of Array.from(part.value)) {\n        const k = seenFrac++\n        side.push(digitNode(ch, `f${k}`, -1 - k))\n      }\n    } else if (part.type === 'group') {\n      side.push({ key: `g${intDigits - seenInt}`, node: part.value })\n    } else {\n      // count repeats (e.g. a space and a direction mark both after the number) so keys stay unique and stable\n      const base = `${part.type}-${side === pre ? 'pre' : side === post ? 'post' : 'num'}`\n      const n = (seen[base] = (seen[base] ?? -1) + 1)\n      side.push({ key: n ? `${base}-${n}` : base, node: part.value })\n    }\n  })\n\n  const finalValue = period === 'yearly' ? y : m\n  const suffixText = typeof suffix === 'string' ? suffix : suffix?.[period]\n  const showCompare = compare && period === 'yearly' && m !== null && y !== null && y < m\n\n  /* auto-fit: a price wider than its container shrinks (down to 45%) instead of spilling out */\n  const rootRef = useRef<HTMLSpanElement>(null)\n  const measureRef = useRef<HTMLSpanElement>(null)\n  const [fit, setFit] = useState(1)\n  /* the old price sits above the number; with no room there (it would cover the text above) it\n     goes beside the price instead */\n  const [wasBeside, setWasBeside] = useState(false)\n  const widest = [m, y].filter((v): v is number => v !== null).map(v => fmt.format(v)).sort((a, b) => b.length - a.length)[0] ?? '—'\n  useEffect(() => {\n    const root = rootRef.current\n    const probe = measureRef.current\n    const box = root?.parentElement\n    if (!root || !probe || !box) return\n    const check = () => {\n      const cs = getComputedStyle(box)\n      const avail = box.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight)\n      const natural = probe.offsetWidth\n      const next = natural > 0 && avail > 0 && natural > avail ? Math.max(0.45, Math.floor((avail / natural) * 100) / 100) : 1\n      setFit(f => (f === next ? f : next))\n      // free space above the price: up to the previous visible element, or the padding of the\n      // nearest ancestor that starts with it\n      const top = root.getBoundingClientRect().top\n      let above = Infinity\n      for (let el: Element = root; el.parentElement && el !== document.body; el = el.parentElement) {\n        let prev = el.previousElementSibling\n        while (prev && (getComputedStyle(prev).position === 'absolute' || getComputedStyle(prev).position === 'fixed' || !prev.getClientRects().length))\n          prev = prev.previousElementSibling\n        if (prev) {\n          above = top - prev.getBoundingClientRect().bottom\n          break\n        }\n        const pcs = getComputedStyle(el.parentElement)\n        if (parseFloat(pcs.paddingTop) + parseFloat(pcs.borderTopWidth) > 0 || pcs.overflow !== 'visible') {\n          above = top - el.parentElement.getBoundingClientRect().top - parseFloat(pcs.borderTopWidth)\n          break\n        }\n      }\n      // the old price is ~0.4em tall (0.32em text on a 1.2 line) and wants a little air above it\n      const beside = above < parseFloat(getComputedStyle(root).fontSize) * 0.44 + 6\n      setWasBeside(b => (b === beside ? b : beside))\n    }\n    check()\n    const ro = new ResizeObserver(check)\n    ro.observe(box)\n    return () => ro.disconnect()\n  }, [widest])\n\n  const sym = (n: Node) =>\n    n.digit ? (\n      n.node\n    ) : (\n      <motion.span\n        key={n.key}\n        className=\"bp-sym\"\n        initial={reduced ? false : { opacity: 0, width: 0 }}\n        animate={{ opacity: 1, width: 'auto' }}\n        exit={{ opacity: 0, width: 0 }}\n        transition={{ duration: 0.25, ease: EASE_OUT }}\n      >\n        {n.node}\n      </motion.span>\n    )\n\n  return (\n    <span ref={rootRef} className={['bp-root', className].filter(Boolean).join(' ')} style={style} data-was={wasBeside ? 'beside' : undefined}>\n      <PricingStyles />\n      <span className=\"bp-sr\">\n        {finalValue === null ? '—' : fmt.format(finalValue)}\n        {suffixText ? ` ${suffixText}` : ''}\n        {showCompare ? `, was ${fmt.format(m)}` : ''}\n      </span>\n      {/* the widest of the two prices at full size, for auto-fit; each digit gets the same 1ch\n          cell as a rolling column, so the probe is as wide as what renders */}\n      <span className=\"bp-measure\" aria-hidden>\n        <span ref={measureRef} className=\"bp-num\">\n          {Array.from(widest, (c, i) => (/\\p{Nd}/u.test(c) ? <span key={i} className=\"bp-cell\">{c}</span> : c))}\n        </span>\n      </span>\n      <span className=\"bp-num\" aria-hidden style={fit < 1 ? { fontSize: `${fit}em` } : undefined}>\n        {value === null ? (\n          <span className=\"bp-sym\">—</span>\n        ) : (\n          <>\n            {/* default mode: exiting columns collapse their own width, no popLayout (Digit takes no ref) */}\n            <AnimatePresence initial={false}>{pre.map(sym)}</AnimatePresence>\n            <span className=\"bp-digits\">\n              <AnimatePresence initial={false}>{num.map(sym)}</AnimatePresence>\n            </span>\n            <AnimatePresence initial={false}>{post.map(sym)}</AnimatePresence>\n          </>\n        )}\n      </span>\n      {suffixText && (\n        <span className=\"bp-suffix\" aria-hidden dir=\"auto\">\n          <Morph text={suffixText} reduced={reduced} />\n        </span>\n      )}\n      <AnimatePresence initial={false}>\n        {showCompare && (\n          <motion.span\n            key=\"was\"\n            className=\"bp-was\"\n            aria-hidden\n            initial={reduced ? { opacity: 0 } : { opacity: 0, y: 6 }}\n            animate={{ opacity: 1, y: 0 }}\n            exit={reduced ? { opacity: 0 } : { opacity: 0, y: 6 }}\n            transition={{ duration: 0.28, ease: EASE_OUT, delay: reduced ? 0 : 0.15 }}\n          >\n            {fmt.format(m ?? 0)}\n            <motion.i\n              className=\"bp-strike\"\n              initial={reduced ? false : { scaleX: 0 }}\n              animate={{ scaleX: 1 }}\n              exit={{ scaleX: 0 }}\n              transition={{ duration: 0.34, ease: EASE_OUT, delay: reduced ? 0 : 0.3 }}\n            />\n          </motion.span>\n        )}\n      </AnimatePresence>\n    </span>\n  )\n}\n\n/* ────────────────────────────────────────────────────────────────────────── */\n/* Text that differs per period                                              */\n/* ────────────────────────────────────────────────────────────────────────── */\n\n/** Props of `<BillingText>`. */\nexport type BillingTextProps = {\n  /** Text on monthly. */\n  monthly: string\n  /** Text on yearly. Words shared with `monthly` glide into place; the rest roll. */\n  yearly: string\n  /** Extra class on the root (`.bt-root`). */\n  className?: string\n  /** Inline styles on `.bt-root`. */\n  style?: CSSProperties\n}\n\n/**\n * A line of plain text that differs per period. Words both lines share glide\n * into place; the rest roll out and in. Must be inside `<Billing>`.\n */\nexport function BillingText({ monthly, yearly, className, style }: BillingTextProps) {\n  const { period, reduced } = useBillingContext('BillingText')\n  const text = period === 'yearly' ? yearly : monthly\n  return (\n    <span className={['bt-root', className].filter(Boolean).join(' ')} style={style}>\n      <PricingStyles />\n      <span className=\"bp-sr\">{text}</span>\n      <span aria-hidden dir=\"auto\">\n        <Morph text={text} reduced={reduced} />\n      </span>\n    </span>\n  )\n}\n\ntype Word = { id: number; text: string }\nlet wordId = 0\n\n/** LCS word diff: shared words keep identity and glide, the rest roll. */\nfunction diffWords(prev: Word[], words: string[]): Word[] {\n  const a = prev.map(w => w.text)\n  const m = a.length\n  const n = words.length\n  const dp = Array.from({ length: m + 1 }, () => new Array<number>(n + 1).fill(0))\n  for (let i = m - 1; i >= 0; i--)\n    for (let j = n - 1; j >= 0; j--) dp[i][j] = a[i] === words[j] ? dp[i + 1][j + 1] + 1 : Math.max(dp[i + 1][j], dp[i][j + 1])\n  const out: Word[] = []\n  let i = 0\n  let j = 0\n  while (j < n) {\n    if (i < m && a[i] === words[j]) {\n      out.push(prev[i])\n      i++\n      j++\n    } else if (i < m && dp[i + 1][j] >= dp[i][j + 1]) i++\n    else out.push({ id: ++wordId, text: words[j++] })\n  }\n  return out\n}\n\nconst roll: Variants = {\n  in: ({ reduced }: { i: number; reduced: boolean }) => (reduced ? { opacity: 0 } : { y: '105%', opacity: 0 }),\n  show: ({ i, reduced }: { i: number; reduced: boolean }) => ({\n    y: 0,\n    opacity: 1,\n    transition: reduced ? { duration: 0.15 } : { type: 'spring', visualDuration: 0.3, bounce: 0.2, delay: Math.min(i * 0.014, 0.3) },\n  }),\n  out: ({ i, reduced }: { i: number; reduced: boolean }) =>\n    reduced ? { opacity: 0, transition: { duration: 0.1 } } : { y: '-105%', opacity: 0, transition: { duration: 0.15, ease: EASE_OUT, delay: Math.min(i * 0.006, 0.15) } },\n}\n\nconst Morph = memo(function Morph({ text, reduced }: { text: string; reduced: boolean }) {\n  // diff against the previous text's words, derived during render (no ref reads)\n  const [diffed, setDiffed] = useState(() => ({ text, words: diffWords([], text.split(/\\s+/).filter(Boolean)) }))\n  let words = diffed.words\n  if (diffed.text !== text) {\n    words = diffWords(diffed.words, text.split(/\\s+/).filter(Boolean))\n    setDiffed({ text, words })\n  }\n  return (\n    <span className=\"bt-line\">\n      <AnimatePresence mode=\"popLayout\" initial={false}>\n        {words.map((w, wi) => (\n          <motion.span\n            key={w.id}\n            className=\"bt-word\"\n            layout={reduced ? false : 'position'}\n            initial=\"in\"\n            animate=\"show\"\n            exit=\"out\"\n            transition={{ layout: { type: 'spring', visualDuration: 0.36, bounce: 0.16 } }}\n          >\n            {glyphsOf(w.text + (wi < words.length - 1 ? ' ' : '')).map((ch, i) => (\n              <motion.span key={i} className=\"bt-ch\" variants={roll} custom={{ i, reduced }}>\n                {ch}\n              </motion.span>\n            ))}\n          </motion.span>\n        ))}\n      </AnimatePresence>\n    </span>\n  )\n})\n\n/* ────────────────────────────────────────────────────────────────────────── */\n/* Styles — injected once, hoisted by React 19                               */\n/* ────────────────────────────────────────────────────────────────────────── */\n\nfunction PricingStyles() {\n  return (\n    <style href=\"pricing-toggle\" precedence=\"medium\">\n      {CSS}\n    </style>\n  )\n}\n\nconst CSS = /* css */ `\n.bs-root, .bp-root, .bt-root {\n  --_ink: var(--pricing-toggle-ink, var(--ui-ink, #17140f));\n  --_pill: var(--ui-radius-pill, 999px);\n  --_surface: var(--pricing-toggle-surface, var(--ui-surface, #fbf8f1));\n  --_accent: var(--pricing-toggle-accent, var(--ui-accent, #d4452b));\n  --_line: color-mix(in oklab, var(--_ink) 13%, transparent);\n  --_muted: color-mix(in oklab, var(--_ink) 62%, transparent); /* 4.5:1 on white and on dark */\n}\n.bp-sr {\n  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;\n  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;\n}\n\n/* switch */\n.bs-root {\n  position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 4px;\n  /* never wider than its container: when the text does not fit on one line it wraps (data-wrap, set in JS) */\n  max-width: 100%; min-width: 0;\n  border-radius: var(--_pill); border: 1px solid var(--_line);\n  background: color-mix(in oklab, var(--_ink) 5%, transparent);\n  color: var(--_ink); font: inherit;\n  user-select: none; -webkit-user-select: none; touch-action: pan-y;\n  -webkit-tap-highlight-color: transparent;\n}\n.bs-thumb {\n  position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: var(--_pill);\n  background: var(--_surface);\n  box-shadow: 0 0 0 1px var(--_line), 0 1px 3px light-dark(rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.03));\n  cursor: grab;\n}\n.bs-root:active .bs-thumb { cursor: grabbing; }\n.bs-root .bs-seg {\n  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px;\n  height: 34px; padding: 0 16px; margin: 0; border: 0; border-radius: var(--_pill);\n  background: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 550; line-height: 1;\n  white-space: nowrap; flex: 0 1 auto; min-width: 0;\n}\n.bs-label { flex: 0 6 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding-block: 0.2em; margin-block: -0.2em; }\n/* too long for one line (long translations, narrow columns): the two segments share the width and\n   wrap their text, so nothing is ever cut off */\n.bs-root[data-wrap] { display: flex; width: 100%; align-items: stretch; }\n/* a pill radius on a two-line segment turns it into a blob: cap the corners while wrapped */\n.bs-root[data-wrap], .bs-root[data-wrap] .bs-seg, .bs-root[data-wrap] .bs-thumb { border-radius: min(var(--_pill), 14px); }\n.bs-root[data-wrap] .bs-seg, .bs-root[data-wrap] .bs-thumb { border-radius: min(var(--_pill), 10px); }\n.bs-root[data-wrap] .bs-seg {\n  flex: 1 1 0; flex-direction: column; justify-content: center; gap: 5px;\n  height: auto; min-height: 34px; padding: 7px 10px; white-space: normal; text-align: center; line-height: 1.2;\n}\n.bs-root[data-wrap] .bs-seg[data-period=\"yearly\"] { padding-right: 10px; }\n.bs-root[data-wrap] .bs-label { overflow: visible; text-wrap: balance; overflow-wrap: anywhere; padding-block: 0; margin-block: 0; }\n/* the badge keeps overflow: hidden, so its sheen stays inside it (the text wraps, so nothing is cut) */\n.bs-root[data-wrap] .bs-badge { border-radius: min(var(--_pill), 8px); max-width: 100%; white-space: normal; text-wrap: balance; overflow-wrap: anywhere; }\n.bs-seg[data-period=\"monthly\"] { color: color-mix(in oklab, var(--_ink) calc(62% + (1 - var(--p, 0)) * 38%), transparent); }\n.bs-seg[data-period=\"yearly\"] { color: color-mix(in oklab, var(--_ink) calc(62% + var(--p, 0) * 38%), transparent); padding-right: 6px; }\n.bs-seg:focus-visible { outline: 2px solid var(--_accent); outline-offset: 2px; }\n@media (pointer: coarse) { .bs-root .bs-seg { height: 44px; min-width: 44px; justify-content: center; } }\n.bs-badge {\n  position: relative; display: inline-block; overflow: hidden; text-overflow: ellipsis;\n  flex: 0 1 auto; min-width: 3.6em; max-width: 16em; white-space: nowrap;\n  padding: 3px 8px; border-radius: var(--_pill);\n  font-size: 11.5px; font-weight: 650; letter-spacing: 0.01em;\n  /* accent pulled toward the ink: 4.5:1 on its own tint, in both themes */\n  color: color-mix(in oklab, var(--_accent) 62%, var(--_ink));\n  background: color-mix(in oklab, var(--_accent) calc(9% + var(--p, 0) * 7%), transparent);\n  transform-origin: 20% 60%;\n}\n.bs-badge-icon { display: inline; vertical-align: -1px; margin-inline-end: 4px; }\n.bs-sheen {\n  --_glint: light-dark(rgb(255 255 255 / 0.65), color-mix(in oklab, var(--_accent) 50%, transparent));\n  position: absolute; inset: -2px 0; pointer-events: none;\n  background: linear-gradient(105deg, transparent 32%, var(--_glint) 50%, transparent 68%);\n}\n\n/* price */\n.bp-root {\n  position: relative; display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.28em;\n  max-width: 100%; min-width: 0;\n  font-variant-numeric: tabular-nums;\n}\n.bp-num { display: inline-flex; align-items: flex-start; line-height: ${LINE}; white-space: nowrap; }\n/* numbers read left to right in every script: keeps \"120\" from turning into \"021\" in RTL pages */\n.bp-digits { display: inline-flex; align-items: flex-start; direction: ltr; unicode-bidi: isolate; }\n/* a 0x0 clipped box: the probe keeps its full width but never adds to the page's scroll width */\n.bp-measure { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }\n.bp-measure > .bp-num { width: max-content; }\n.bp-cell { display: inline-block; width: 1ch; text-align: center; }\n.bp-col { position: relative; display: inline-block; height: ${LINE}em; overflow: hidden; text-align: center; }\n.bp-col[data-rolling] { mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }\n.bp-still { display: block; height: ${LINE}em; line-height: ${LINE}; }\n.bp-strip { display: flex; flex-direction: column; align-items: center; }\n.bp-strip > span { height: ${LINE}em; line-height: ${LINE}; }\n.bp-sym { display: inline-block; overflow: hidden; height: ${LINE}em; white-space: pre; }\n.bp-suffix { min-width: 0; max-width: 100%; font-size: 0.36em; font-weight: 500; color: var(--_muted); letter-spacing: 0; overflow-wrap: anywhere; }\n.bp-was {\n  /* sits above the price, out of flow: appearing never shifts the layout */\n  position: absolute; left: calc(0.04em - 2px); bottom: 100%; margin-bottom: 0.06em;\n  font-size: 0.32em; font-weight: 500; line-height: 1.2; white-space: nowrap;\n  /* padding keeps the strike's overhang inside the clip */\n  max-width: calc(100% / 0.32); overflow: hidden; text-overflow: ellipsis; padding-inline: 2px;\n  color: var(--_muted); letter-spacing: 0;\n}\n.bp-root[data-was=\"beside\"] .bp-was { position: relative; left: auto; bottom: auto; margin: 0; }\n.bp-strike {\n  position: absolute; left: 0; right: 0; top: 54%; height: 1.5px; border-radius: 1px;\n  background: color-mix(in oklab, var(--_accent) 80%, transparent); transform-origin: 0 50%;\n}\n\n/* morphing text */\n/* words wrap between each other; a word longer than the line breaks between its letters */\n.bt-line { display: inline; }\n.bt-root { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }\n.bt-word { position: relative; display: inline-block; vertical-align: top; overflow: hidden; max-width: 100%; }\n.bt-ch { display: inline-block; vertical-align: top; white-space: pre; }\n`\n\nexport default Billing\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "tier": "free",
    "version": "1.0.0",
    "docs": "https://brioui.com/docs/components/pricing-toggle",
    "license": "MIT"
  },
  "docs": "Docs: https://brioui.com/docs/components/pricing-toggle",
  "categories": [
    "Commerce"
  ],
  "type": "registry:ui"
}