Glass Capsule Stack
ProA frosted glass tube that stacks feature chips and drops the oldest into a card.
Overview
Glass Capsule Stack is a React and Tailwind CSS feature showcase for landing pages that drops your feature chips into a frosted glass tube, in Next.js or any React app, animated with Framer Motion. On each beat a chip falls in with a small squash, the stack settles, and the oldest chip squeezes out of the floor into a featured card. The loop stops off screen, in background tabs, for reduced motion, or with paused, and screen readers get the chips as a plain list. Keep at least one more chip than stackSize, or the stack shrinks to avoid repeats.
Installation
Run the following command
pnpm dlx wensity@latest add glass-hopper
Usage
Import GlassHopper from @/components/wensity/glass-hopper and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.
"use client";import { GlassHopper } from "@/components/wensity/glass-hopper";import { IconBolt, IconShieldCheck, IconSparkles, IconUsers } from "@tabler/icons-react";export default function Example() {return (<GlassHopperintervalMs={2200}stackSize={3}chips={[{id: "ready",title: "Production Ready",description: "Fully type-safe and tested",icon: <IconShieldCheck className="size-5" stroke={1.75} />,},{id: "motion",title: "Fluid Motion",description: "60fps optimizations built-in",icon: <IconBolt className="size-5" stroke={1.75} />,},{id: "a11y",title: "Accessible",description: "Works perfectly for everyone",icon: <IconUsers className="size-5" stroke={1.75} />,},{id: "design",title: "Modern Design",description: "Crafted for high-end feel",icon: <IconSparkles className="size-5" stroke={1.75} />,},]}/>);}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
chips | GlassHopperChip[] | - | Feature chips that cycle through the capsule. Each needs id, title, description, and icon. Pass at least one more chip than stackSize so the tray never repeats a stacked chip. |
intervalMs | number | 2200 | Milliseconds between drops. |
paused | boolean | false | Pause the drop loop without unmounting. |
stackSize | number | 3 | Chips stacked inside the capsule, clamped to 2-5. Also sets the tube height. |
glassTint | string | "#ffffff" | Tint for the glass tube, rim, and sheen. |
accentColor | string | "#cd1c18" | Accent color for icon badges and the slot light. |
