Why
Most product illustrations are pictures. These are objects: the key goes down when you press it and comes back up when you let go, the screen says what happened, and you can hear it. isokit gives you the few pieces that make that easy, so a figure is a list of boxes, not an afternoon in a design tool.
- Real isometric. True 30° projection, no perspective, no WebGL. Plain SVG that stays crisp at any size.
- Draw on faces, not polygons. Every face takes ordinary
<rect>, <path> and <text> in its own flat coordinates. Screens, labels and vents land in projection for free.
- Presses that feel physical. Down on press, up on release, acts on release. Pointer, touch, Enter and Space.
- Sound, done properly. Twelve synthesized interaction sounds, no audio files, loaded only when someone reaches for a figure, silent until the page opts in.
- Typed and validated. Every public type is inferred from a zod schema. In development, bad input is explained in the console; in production it is clamped and costs nothing.
- Light on the page. 3.1 kB core, the sound engine is a separate 2.6 kB chunk, loops sleep offscreen, server rendering works.
Quick start
npm i react-isokit
import { useState } from "react"
import { Box, Plate, Press } from "react-isokit"
import "react-isokit/styles.css"
const key = { x: 0, y: 0, z: 0, w: 60, d: 60, h: 14 }
export function Key() {
const [n, setN] = useState(0)
return (
<Plate label="A key you can press" fit={[key]} readout={`pressed ${n}×`}>
<Press label="Press the key" onPress={() => setN(n + 1)}>
<g><Box {...key} r={10} /></g>
</Press>
</Plate>
)
}
That is a working, accessible, keyboard-operable key that sinks and springs back. Add configureSound({ defaultOn: true }) once, and it clicks.
How it works
World space. +x runs down-right, +y runs down-left, +z runs up, all 120° apart. A box is its back-left-bottom corner and its size: { x, y, z, w, d, h }. Units are yours; Plate scales the result to fit.
Paint order is depth. There is no depth buffer: later shapes cover earlier ones. Emit back to front: smaller x + y first, lower z first, and for a grid, rows by y then columns by x.
Faces are flat. Box takes top, front and side children, each drawn in that face's own coordinates:
| Face | Faces toward | Local x | Local y | Origin |
|---|
top | up | along +x | along +y | back-left corner |
front | lower-left | along +x | down | top-left corner |
side | lower-right | front edge → back | down | top-front corner |
<Box x={0} y={0} z={0} w={150} d={48} h={46} r={8}
front={<>
<rect className="ik-screen" x={9} y={8} width={106} height={30} rx={4} />
<text className="ik-screen-text" x={15} y={30} fontSize={9.5}>Deploy preview?</text>
</>}
/>
API
Components
<Plate>
The numbered plate a figure sits on, and the <svg> it is drawn in.