Grid Serpent
gamesProA snake that plays itself on a pixel grid: it hunts food by pathfinding, grows endlessly, flashes and restarts when it corners itself. Tail fades into the board; cell size, gap, radius, colours, speed and growth are props.
Introductory price until 31 December 2026. €79 after that.
Preview
Live demo. The theme switches the demo itself.
Code
The code is locked
Grid Serpent is part of Manniche UI Pro. A key unlocks the source of all 66 effects.
Buy · €49€49 · Introductory price until 31 December 2026. €79 after that.
- One-off payment
- One developer
- Sign in and create your key straight away
- No VAT (§ 19 UStG)
Have a key? Get the code with the CLI or MCP.
The key lives in MANNICHE_PRO_KEY, never in your code or a URL. How to set it up
npx shadcn@latest add @manniche-pro/grid-serpentclaude mcp add --transport http manniche-ui https://mikkelmanniche.dk/api/mcp --header "Authorization: Bearer $MANNICHE_PRO_KEY"Props
GridSerpentProps
| Prop | Type | Default | What it does |
|---|---|---|---|
cellSize | number | 16 | Side of one cell in CSS pixels. The board fills its container, so a smaller cell means a bigger grid. |
gap | number | 3 | Space between cells in CSS pixels. |
radius | number | 4 | Corner radius of a cell, in CSS pixels. Half the cell size makes dots, 0 makes square pixels. |
snakeColor | string | 'var(--foreground)' | Colour of the snake's head; the body fades from it towards the board. Any CSS colour, including var(--x). Defaults to the foreground token. |
foodColor | string | 'var(--primary)' | Colour of the food. Defaults to the primary token. |
boardColor | string | 'var(--muted)' | Colour of the empty cells. Defaults to the muted token. |
flashColor | string | 'var(--destructive)' | Colour the snake blinks in when it corners itself. Defaults to the destructive token. |
speed | number | 16 | Steps per second. |
growth | number | 4 | Segments added to the snake for every piece of food. |
maxFill | number | 0.1 | How full the board may get, from 0.02 to 0.9. Past this share of the cells the snake stops being careful, corners itself, flashes and starts again. Raise it for longer lives, lower it for a quick cycle. Up to 0.12 the snake hunts the food directly, which is quick. Above that it follows a loop through the board, which is slower to reach the food but never dies on its own, so it can fill the board. |
seed | number | 7 | Seed for the food placement, so every visit plays out the same. Changing it starts a new game right away. |
feedable | boolean | true | Click or tap a free cell to drop the food there (never blocks scrolling). By keyboard, tab to the board, aim with the arrow keys and press Enter or Space; a hint shows while it is focused. |
label | string | – | Accessible label. When set the board is exposed as an image, otherwise it is hidden from assistive technology. |
className | string | – | Classes for the wrapper. It fills its parent, so give it a size or put it in a sized box. |
A11y
Keyboard
With feedable the board takes focus with Tab and shows an aim cursor and a hint. Arrow keys move the aim, Enter or Space drops the food there, and the result is announced. A click or tap on a free cell does the same.
Screen reader
With feedable the board is a group named by label (or Snake board) with the keys in its name; otherwise the canvas is aria-hidden unless label is set, which makes it an image with that name.
Reduced motion
Under reduced motion one still frame is drawn.