ham7a311

Ledger Cylinder

Component

About

A scroll-driven stats section that paints large stat numbers and labels onto the inside wall of a WebGL cylinder, rotating the ring as the user scrolls, with a static accessible fallback for reduced motion.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Ledger Cylinder to your project and fits it to your theme.

Code

How Ledger Cylinder is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import LedgerCylinder from "@/components/ui/ledger-cylinder";
import { useRef } from "react";

const PALETTE = {
  stats: ["#8fe388", "#ede8df", "#ff6b00"],
  notes: "#ffe3b8",
  status: "#8fe388",
  bg: "#0e0d0b",
};

export default function Demo() {
  const scroller = useRef<HTMLDivElement>(null);

  return (
    <div
      ref={scroller}
      className="relative h-screen w-full overflow-y-auto overscroll-contain"
      style={{ background: PALETTE.bg }}
    >
      <div className="flex h-[38%] min-h-40 flex-col items-center justify-end pb-6 text-center font-mono text-[11px] uppercase tracking-[0.2em] text-white/40">
        Scroll inside the frame ↓
      </div>
      <LedgerCylinder
        scrollRoot={scroller}
        background={PALETTE.bg}
        stats={[
          { value: "48K+", label: "Downloads", color: PALETTE.stats[0] },
          { value: "1.2M", label: "Requests / day", color: PALETTE.stats[1] },
          { value: "98.4%", label: "Uptime", color: PALETTE.stats[2] },
        ]}
        notes={{
          label: "Currently",
          items: [
            "Rebuilding the search index",
            "Testing a calmer onboarding",
            "Writing the v2 migration guide",
          ],
          color: PALETTE.notes,
        }}
        status={{
          lines: ["> uptime: 412 days", "> status: shipping"],
          color: PALETTE.status,
        }}
      />
      <div className="flex h-[60%] min-h-48 items-center justify-center font-mono text-[11px] uppercase tracking-[0.2em] text-white/30">
        End of section
      </div>
    </div>
  );
}

More by ham7a311

View all
  • Route Globe

    Route Globe

    12
  • Wave Mesh

    Wave Mesh

    7
  • Uptime Ribbon

    Uptime Ribbon

    6
  • Glass Carousel

    Glass Carousel

    6
  • Glass Tiles

    Glass Tiles

    6
  • Streak Field Stats

    Streak Field Stats

    5
  • Wind Map

    Wind Map

    5
  • Time Window

    Time Window

    4