Snake Loader

A progress loader whose visual is a tiny snake board. The snake plays itself while you wait, progress fills a row of tiles beneath it, and the status line carries the label, current step and percentage. Done offers continue; an error crashes the snake and offers a retry. Click the board and the snake is yours.

Try it: Watch it load — or click the board (or press an arrow key) to steer the snake while you wait.

Installation

Install with the shadcn CLI:

npx shadcn@latest add https://www.framekitui.live/r/snake-loader.json

Or, with the @framekit namespace registered: npx shadcn@latest add @framekit/snake-loader. You can also copy the source into components/ui/snake-loader.tsx (view on GitHub).

Usage

import { SnakeLoader } from '@/components/ui/snake-loader'

Props

Component props
PropTypeDefaultNotes
progressnumber—0–100, drawn as a row of tiles plus a counting percentage. Omit for an indeterminate wave. 100 counts as done.
state'loading' | 'done' | 'error''loading'Done shows a check; error crashes the snake, tints the tiles rose and is announced as an alert.
label / descriptionstring'Loading'Status line and an optional secondary line (current step, counts, ETA).
readyLabel / errorLabelstring'Ready' / 'Something went wrong'Status line for the done and error states.
onContinue / continueLabel() => void / string'Continue'Adds a continue button when done.
onRetry / retryLabel() => void / string'Try again'Adds a retry button on error.
showPercent / showProgressbooleantrueHide the percentage or the tile progress row.
variant'card' | 'plain''card'plain drops the card surface so the loader sits inside your own layout.
colorstring—Accent (#rrggbb) for the snake, trail and progress. Defaults to emerald.
interactivebooleantrueLet people take over the snake. false makes it a pure animation.
autoPlaybooleantrueThe snake plays itself (always off under reduced motion).
cols / rowsnumber18 / 10Board size in tiles (cols 10–30, rows 6–20).
speed / wrapnumber / boolean120 / falsems per step while someone plays; wrap makes walls pass-through.
skin'tiles' | 'lcd''tiles'Glossy snake on soft tiles, or a pixel nod to the classic phone screen.
theme'auto' | 'light' | 'dark''auto'auto follows the nearest .dark / .light ancestor.
onGameOver(score, best) => void—Fires when a played round ends.
className / boardClassNamestring—Style the wrapper and the board.

Dependencies

  • motion
  • lucide-react
  • Login Gate Intro

    A lock-screen preloader: oversized clock, generated avatar card, a password field that types itself, a three-step sign-in sequence, then the site fades up. Skip link included; reduced motion opens…

  • Lattice Pulse Loader

    3×3 nodes pulse in a traveling wave.

  • Cook Loading

    An illustrated chef stirs a sizzling wok while your app loads — eight original cooking poses, drifting steam, real progress and ready/error states in one self-contained component.

  • Particle Morph Loader

    A depth-lit swarm of motes spins in 3D and melts between sphere, ribbon, shell, tetra, ring and helix while a status word rolls underneath.

  • Hourglass Loader

    A brass-and-glass hourglass: sand drains from the upper bulb through a trickling stream into a growing mound, and in endless mode the glass turns itself over on a spring when the top runs dry. Pass…

  • Ghost Gobbler Skull

    A glossy vinyl-toy skull that tracks little black-smoke ghosts drifting in from every direction, drops its jaw, slurps each one in like spaghetti and CHOMPS — then levels up: glowing eyes, blush…

See all 11 Loading components