Infinite Canvas

Infinite draggable canvas with zoomable, repeating cards and touch/mouse controls.

Drag to pan • Scroll to zoom
100%

Installation

npx shadcn@latest add https://scrollxui.dev/registry/infinite-canvas.json 

Usage

import { Card, InfiniteCanvas } from "@/components/ui/infinite-canvas";
 <InfiniteCanvas 
      className="relative h-[450px] w-full"
      showControls={true}
      showZoom={true}
      showStatus={true}
      showInstructions={true}
    >
    <Card className="bg-card p-6 rounded-lg shadow-lg border h-full">
    <p className="text-foreground">
          Card 1 
        </p>
    </Card>
   <Card className="bg-card p-6 rounded-lg shadow-lg border h-full">
    <p className="text-foreground">
          Card 1 
        </p>
    </Card>
    <Card className="bg-card p-6 rounded-lg shadow-lg border h-full">
    <p className="text-foreground">
          Card 1 
        </p>
    </Card>
    </InfiniteCanvas>

API Reference

Infinite Canvas

Infinite draggable canvas with zoomable, repeating cards and touch/mouse controls.

Props

PropertyTypeDefaultDescription
childrenReactNoderequired
Card components rendered infinitely across the canvas grid.
classNamestring-
Additional CSS classes applied to the canvas container.
cardWidthnumber280
Fixed width of each card in pixels.
cardHeightnumber220
Fixed height of each card in pixels.
spacingnumber30
Space between cards in the infinite grid layout.
showControlsbooleantrue
Show button to enable or disable canvas interaction.
showZoombooleantrue
Display current zoom percentage indicator.
showStatusbooleantrue
Show active/inactive status badge for the canvas.
showInstructionsbooleantrue
Display drag and zoom usage instructions overlay.

Built withby Ahdeetai.