Charcoal UI

Hexagon Grid

A honeycomb of faint hexagons that light up under the pointer and cool slowly behind it, leaving a glowing trail, with a few cells sparking on their own. Canvas, written in the file.

  • Category: Animated React Backgrounds
  • Licence: Free, MIT
  • Built with: React 19, Tailwind CSS 4, Motion
  • Dependencies: motion, clsx, tailwind-merge

Examples

Hexagon Grid

API reference

PropTypeDefaultDescription
sizenumber26Px.
colorstring"var(--ember)"
fadenumber1.2Seconds.
ambientnumber2Cells per second.
classNamestring—

About Hexagon Grid

Hexagon Grid draws a honeycomb of faint hexagons that light up under the pointer and cool slowly behind it, leaving a glowing trail, with a few cells sparking on their own.

Hexagon Grid is an animated background for React 19, styled with Tailwind CSS 4 and animated with Motion. It drops into Next.js, Vite, Remix or Astro through the shadcn CLI as a single file you own.

When to use Hexagon Grid

  • Gaming and esports sites.
  • Security and network product heroes.
  • Developer dashboards.
  • Sci-fi and futuristic brands.

How it works

The idle grid is drawn once to an offscreen canvas, so each frame only paints the cells that are warm. The cell under the pointer is found with axial coordinates and cube rounding.

The whole layer is decorative and aria-hidden, sits behind your content without taking pointer events it does not need, and pauses when scrolled off screen. With prefers-reduced-motion on, it holds still or settles instantly instead of animating.

Customizing Hexagon Grid

Every prop is documented in the API reference above with its type and default. The ones you will reach for first are listed here.

The Customize panel next to the preview lets you change size, fade, ambient, color live, and the Code tab updates to match, so the snippet you copy already carries your values.

  • size (number, default 26): Px.
  • color (string, default "var(--ember)").
  • fade (number, default 1.2): Seconds.
  • ambient (number, default 2): Cells per second.

Goes well with Hexagon Grid

These backgrounds pieces share its tokens and motion language, so they sit together on one page without clashing.

  • Dot Grid: An interactive React dot grid background whose dots swell near the pointer
  • Grain: A React film grain overlay that removes gradient banding
  • Grainient: A free React WebGL grainy gradient with three flowing colours
  • Ember Field: An animated React ember background: glowing embers drift up and flicker as they cool
  • Smoke: A slow React smoke background: blurred plumes drifting over dark sections, CSS only

Install Hexagon Grid

npx shadcn@latest add https://charcoalui.com/r/hexagon-grid.json

Hexagon Grid is free and MIT licensed. The command copies hexagon-grid.tsx into components/ui and installs clsx, tailwind-merge; you can also copy the source from the Code tab by hand.

Charcoal UI Pro adds 393 more showpiece components, 112 sections and 100 templates built the same way.

Frequently asked questions

How do I install Hexagon Grid?
Run npx shadcn@latest add https://charcoalui.com/r/hexagon-grid.json. The shadcn CLI copies hexagon-grid.tsx into components/ui and installs motion, clsx, tailwind-merge. You can also copy the source from this page by hand.
Is Hexagon Grid free for commercial use?
Yes. Hexagon Grid is MIT licensed: use it in any personal or commercial project and change it however you like.
Does Hexagon Grid work with Next.js?
Yes. It is a client component for React 19 styled with Tailwind CSS 4, so it works in the Next.js App Router and Pages Router, Vite, Remix and Astro.
Can an AI coding agent install Hexagon Grid?
Yes. Connect the Charcoal UI MCP server (https://charcoalui.com/mcp) to Claude Code, Cursor or any MCP client; get_component returns Hexagon Grid's props and source and get_install_command returns the exact command.

Hexagon Grid as Markdown · llms.txt