{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"feature-grid","type":"registry:block","title":"Feature Grid","description":"Bento grid of six features where each tile runs a small live micro-animation — a typing command, a theme toggle, a moving focus ring, a rolling counter, springy bars and a clicking cursor — and lifts on hover.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":["@geturui/number-ticker","@geturui/switch"],"files":[{"path":"registry/geturui/blocks/feature-grid.tsx","type":"registry:block","target":"components/blocks/feature-grid.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useInView } from \"motion/react\";\nimport { Activity, ChartColumn, Blocks, Keyboard, Palette, Terminal, MousePointer2 } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { NumberTicker } from \"@/components/ui/number-ticker\";\nimport { Switch } from \"@/components/ui/switch\";\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (cb: () => void) => {\n  const m = window.matchMedia(REDUCE);\n  m.addEventListener(\"change\", cb);\n  return () => m.removeEventListener(\"change\", cb);\n};\n/** Reduced-motion preference that is false on the server and during hydration, so the first render matches. */\nfunction useReducedMotionSafe() {\n  return React.useSyncExternalStore(subscribeReduce, () => window.matchMedia(REDUCE).matches, () => false);\n}\n\n/** Built-in micro-animations a tile can show. */\nexport type FeatureVisual = \"typing\" | \"toggle\" | \"focus\" | \"ticker\" | \"bars\" | \"cursor\";\n\nexport interface Feature {\n  title: string;\n  description: string;\n  icon?: React.ReactNode;\n  /** Built-in live illustration for the tile. */\n  visual?: FeatureVisual;\n  /** Your own illustration; overrides `visual`. */\n  media?: React.ReactNode;\n}\n\nexport interface FeatureGridProps {\n  eyebrow?: string;\n  heading?: string;\n  subheading?: string;\n  /** Six features fill the bento exactly; more wrap into extra rows. */\n  features?: Feature[];\n  className?: string;\n}\n\nfunction useTick(ms: number, active: boolean) {\n  const [n, setN] = React.useState(0);\n  React.useEffect(() => {\n    if (!active) return;\n    const t = setInterval(() => setN((x) => x + 1), ms);\n    return () => clearInterval(t);\n  }, [ms, active]);\n  return n;\n}\n\nconst COMMAND = \"npx shadcn add @geturui/pricing-section\";\n\nfunction TypingVisual({ active }: { active: boolean }) {\n  const tick = useTick(70, active);\n  const cycle = COMMAND.length + 24;\n  const shown = active ? Math.min(COMMAND.length, tick % cycle) : COMMAND.length;\n  const done = shown === COMMAND.length;\n  return (\n    <div className=\"grid w-full max-w-sm gap-2 rounded-md border border-border bg-surface-sunken p-3 font-mono text-[12px] leading-5\">\n      <div className=\"flex items-center gap-1.5 text-ink\">\n        <span className=\"text-volt-ink\">$</span>\n        <span className=\"truncate\">{COMMAND.slice(0, shown)}</span>\n        <motion.span\n          className=\"inline-block h-3.5 w-[7px] shrink-0 bg-volt\"\n          animate={active ? { opacity: [1, 0, 1] } : { opacity: 1 }}\n          transition={{ duration: 0.9, repeat: Infinity, ease: \"linear\" }}\n        />\n      </div>\n      <motion.div\n        className=\"text-success\"\n        initial={false}\n        animate={{ opacity: done ? 1 : 0, y: done ? 0 : 4 }}\n        transition={{ type: \"spring\", stiffness: 400, damping: 30 }}\n      >\n        ✓ Added components/blocks/pricing-section.tsx\n      </motion.div>\n    </div>\n  );\n}\n\nfunction ToggleVisual({ active }: { active: boolean }) {\n  const tick = useTick(1800, active);\n  const [manual, setManual] = React.useState<boolean | null>(null);\n  const on = manual ?? tick % 2 === 0;\n  return (\n    <div className=\"flex w-full items-center justify-center gap-4\">\n      <motion.div\n        aria-hidden\n        className={cn(\"grid w-28 gap-1.5 rounded-md border p-2.5 transition-colors duration-300\", on ? \"border-border bg-ink\" : \"border-border bg-surface-raised\")}\n        animate={{ rotate: on ? -2 : 2 }}\n        transition={{ type: \"spring\", stiffness: 300, damping: 20 }}\n      >\n        <span className={cn(\"h-1.5 w-12 rounded-full transition-colors duration-300\", on ? \"bg-bg/40\" : \"bg-ink/20\")} />\n        <span className={cn(\"h-1.5 w-16 rounded-full transition-colors duration-300\", on ? \"bg-bg/30\" : \"bg-ink/15\")} />\n        <span className=\"mt-1 h-4 w-10 rounded-full bg-volt\" />\n      </motion.div>\n      <Switch\n        checked={on}\n        onCheckedChange={(v) => setManual(v)}\n        aria-label=\"Preview theme toggle\"\n      />\n    </div>\n  );\n}\n\nconst FOCUS_ITEMS = [\"Tab\", \"Enter\", \"Esc\"];\n\nfunction FocusVisual({ active }: { active: boolean }) {\n  const tick = useTick(1100, active);\n  const ringId = React.useId();\n  const at = active ? tick % FOCUS_ITEMS.length : 0;\n  return (\n    <div aria-hidden className=\"flex items-center gap-2.5\">\n      {FOCUS_ITEMS.map((k, i) => (\n        <span key={k} className=\"relative\">\n          {at === i && (\n            <motion.span\n              layoutId={`focus-ring-${ringId}`}\n              className=\"absolute -inset-1 rounded-[12px] shadow-[var(--focus-ring)]\"\n              transition={{ type: \"spring\", stiffness: 420, damping: 30 }}\n            />\n          )}\n          <span\n            className={cn(\n              \"relative inline-flex h-9 min-w-12 items-center justify-center rounded-sm border bg-surface-raised px-3 font-mono text-[12px] shadow-[inset_0_-2px_0_var(--border)] transition-colors\",\n              at === i ? \"border-border-strong text-ink\" : \"border-border text-ink-muted\",\n            )}\n          >\n            {k}\n          </span>\n        </span>\n      ))}\n    </div>\n  );\n}\n\nconst TICKS = [48210, 48362, 48539, 48711, 48904];\n\nfunction TickerVisual({ active }: { active: boolean }) {\n  const tick = useTick(2200, active);\n  const value = TICKS[tick % TICKS.length];\n  return (\n    <div className=\"grid justify-items-center gap-1\">\n      <NumberTicker value={value} className=\"font-display text-[34px] font-semibold tracking-[-1px] text-ink\" />\n      <span className=\"inline-flex items-center gap-1.5 text-[12px] font-medium text-ink-muted\">\n        <span className=\"size-1.5 rounded-full bg-success animate-pulse-dot text-success\" aria-hidden /> weekly installs\n      </span>\n    </div>\n  );\n}\n\nconst BAR_SETS = [\n  [40, 72, 56, 88, 64, 96, 78],\n  [64, 48, 90, 60, 82, 54, 92],\n  [52, 86, 70, 44, 94, 68, 80],\n];\n\nfunction BarsVisual({ active }: { active: boolean }) {\n  const tick = useTick(1600, active);\n  const bars = BAR_SETS[tick % BAR_SETS.length];\n  return (\n    <div aria-hidden className=\"flex h-24 w-full max-w-[220px] items-end gap-2\">\n      {bars.map((h, i) => (\n        <motion.span\n          key={i}\n          className={cn(\"flex-1 origin-bottom rounded-t-[6px] rounded-b-[3px]\", i === 5 ? \"bg-volt\" : \"bg-surface-raised ring-1 ring-inset ring-border\")}\n          style={{ height: \"100%\" }}\n          initial={false}\n          animate={{ scaleY: h / 100 }}\n          transition={{ type: \"spring\", stiffness: 220, damping: 12, delay: i * 0.03 }}\n        />\n      ))}\n    </div>\n  );\n}\n\nconst CURSOR_SPOTS = [\n  { x: 18, y: 26, target: 0 },\n  { x: 112, y: 62, target: 1 },\n  { x: 206, y: 26, target: 2 },\n];\n\nfunction CursorVisual({ active }: { active: boolean }) {\n  const tick = useTick(1300, active);\n  const spot = CURSOR_SPOTS[active ? tick % CURSOR_SPOTS.length : 1];\n  const labels = [\"Hero\", \"Pricing\", \"FAQ\"];\n  return (\n    <div aria-hidden className=\"relative h-24 w-[260px]\">\n      {labels.map((l, i) => (\n        <motion.span\n          key={l}\n          className={cn(\n            \"absolute inline-flex h-8 items-center gap-1.5 rounded-full border px-3 text-[12px] font-medium transition-colors duration-200\",\n            spot.target === i ? \"border-transparent bg-volt text-on-volt\" : \"border-border bg-surface-raised text-ink-muted\",\n          )}\n          style={{ left: i * 94, top: i === 1 ? 46 : 10 }}\n          animate={{ scale: spot.target === i ? [1, 0.94, 1] : 1 }}\n          transition={{ duration: 0.3, delay: 0.45 }}\n        >\n          <Blocks className=\"size-3\" /> {l}\n        </motion.span>\n      ))}\n      <motion.span\n        className=\"absolute left-0 top-0 text-ink drop-shadow-[0_2px_4px_rgb(0_0_0/0.4)]\"\n        initial={false}\n        animate={{ x: spot.x + 34, y: spot.y + 8 }}\n        transition={{ type: \"spring\", stiffness: 160, damping: 20 }}\n      >\n        <MousePointer2 className=\"size-5 fill-ink\" />\n      </motion.span>\n    </div>\n  );\n}\n\nconst VISUALS: Record<FeatureVisual, React.ComponentType<{ active: boolean }>> = {\n  typing: TypingVisual,\n  toggle: ToggleVisual,\n  focus: FocusVisual,\n  ticker: TickerVisual,\n  bars: BarsVisual,\n  cursor: CursorVisual,\n};\n\nconst DEFAULT_FEATURES: Feature[] = [\n  {\n    title: \"Copy, paste, own it\",\n    description: \"One command drops the source into your repo. No runtime package, no lock-in.\",\n    icon: <Terminal className=\"size-4\" />,\n    visual: \"typing\",\n  },\n  {\n    title: \"Token-driven theming\",\n    description: \"Every surface reads your CSS variables, so dark and light just work.\",\n    icon: <Palette className=\"size-4\" />,\n    visual: \"toggle\",\n  },\n  {\n    title: \"Keyboard first\",\n    description: \"Arrow keys, Escape and visible focus rings on every interactive part.\",\n    icon: <Keyboard className=\"size-4\" />,\n    visual: \"focus\",\n  },\n  {\n    title: \"Used in production\",\n    description: \"Teams ship GetUrUI in dashboards, docs and storefronts every week.\",\n    icon: <ChartColumn className=\"size-4\" />,\n    visual: \"ticker\",\n  },\n  {\n    title: \"Tuned springs\",\n    description: \"Stiffness and damping picked per interaction, not one curve for everything.\",\n    icon: <Activity className=\"size-4\" />,\n    visual: \"bars\",\n  },\n  {\n    title: \"Blocks that compose\",\n    description: \"Sections are built from the same primitives you already use, so edits stay small.\",\n    icon: <Blocks className=\"size-4\" />,\n    visual: \"cursor\",\n  },\n];\n\nconst SPANS = [\"@xl:col-span-2 @4xl:col-span-2\", \"\", \"\", \"\", \"\", \"@xl:col-span-2 @4xl:col-span-2\"];\n\nfunction Tile({ feature, index }: { feature: Feature; index: number }) {\n  const ref = React.useRef<HTMLElement>(null);\n  const inView = useInView(ref, { margin: \"-60px\" });\n  const reduce = useReducedMotionSafe();\n  const Visual = feature.visual ? VISUALS[feature.visual] : null;\n  return (\n    <motion.article\n      ref={ref}\n      className={cn(\n        \"group/tile flex flex-col overflow-hidden rounded-lg border border-border bg-surface transition-[border-color,box-shadow] duration-200 hover:border-border-strong hover:shadow-md\",\n        SPANS[index % SPANS.length],\n      )}\n      initial={reduce ? { opacity: 0 } : { opacity: 0, y: 16 }}\n      whileInView={{ opacity: 1, y: 0 }}\n      viewport={{ once: true, margin: \"-40px\" }}\n      whileHover={reduce ? undefined : { y: -4 }}\n      transition={{ type: \"spring\", stiffness: 300, damping: 28, delay: (index % 3) * 0.06 }}\n    >\n      <div className=\"relative flex h-40 items-center justify-center overflow-hidden border-b border-border px-5 dot-grid\">\n        <div className=\"pointer-events-none absolute inset-0 bg-[radial-gradient(closest-side,transparent,var(--surface))]\" />\n        <div className=\"relative flex w-full items-center justify-center\">\n          {feature.media ?? (Visual ? <Visual active={inView && !reduce} /> : null)}\n        </div>\n      </div>\n      <div className=\"grid gap-1.5 p-5\">\n        <h3 className=\"flex items-center gap-2 text-[15px] font-semibold text-ink\">\n          {feature.icon && <span className=\"text-volt-ink\">{feature.icon}</span>}\n          {feature.title}\n        </h3>\n        <p className=\"text-sm leading-[22px] text-ink-muted\">{feature.description}</p>\n      </div>\n    </motion.article>\n  );\n}\n\n/** Bento grid of six features; each tile runs a small live micro-animation while in view and lifts on hover. */\nexport function FeatureGrid({\n  eyebrow = \"Why GetUrUI\",\n  heading = \"Motion that feels considered, code that stays yours\",\n  subheading = \"Everything you need to ship polished interfaces without hand-tuning every transition.\",\n  features = DEFAULT_FEATURES,\n  className,\n}: FeatureGridProps) {\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-6xl gap-12\">\n        <header className=\"mx-auto grid max-w-2xl 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        </header>\n        <div className=\"grid grid-cols-1 gap-4 @xl:grid-cols-2 @4xl:grid-cols-3\">\n          {features.map((f, i) => (\n            <Tile key={f.title} feature={f} index={i} />\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","features","bento","grid","landing","micro-interaction","marketing"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/feature-grid"}}