Skip to content

Quickstart

Terminal window
npm install @glyphcss/react
import { GlyphCamera, GlyphScene, GlyphOrbitControls, GlyphMesh, GlyphHotspot } from "@glyphcss/react";
export function App() {
return (
<GlyphCamera rotX={25} zoom={50}>
<GlyphScene>
<GlyphOrbitControls drag wheel />
<GlyphMesh geometry="cuboctahedron">
<GlyphHotspot id="vertex" at={[1, 0, 0]} onClick={() => alert("vertex")} />
</GlyphMesh>
</GlyphScene>
</GlyphCamera>
);
}
  • A single <pre> rendered as ASCII glyphs — no canvas, no WebGL.
  • Drag-to-orbit and scroll-to-zoom out of the box via <GlyphOrbitControls>.
  • One absolutely-positioned <div class="glyph-hotspot"> for each <GlyphHotspot>, re-projected through the same camera each render so it stays glued to the mesh.
import { GlyphCamera, GlyphScene, GlyphOrbitControls, GlyphMesh } from "@glyphcss/react";
import { icosahedronPolygons } from "@glyphcss/core";
const icosa = icosahedronPolygons({ center: [0, 0, 0], size: 1, color: "#44ffcc" });
export function IcosahedronDemo() {
return (
<GlyphCamera rotX={25} zoom={50}>
<GlyphScene mode="solid">
<GlyphOrbitControls />
<GlyphMesh polygons={icosa} />
</GlyphScene>
</GlyphCamera>
);
}

Next: Core Concepts to understand what’s happening under the hood.