← All elements

Hexagon Menu Cluster

by @admin · 0 views

<div class="hm"><button type="button" class="c">Menu</button><button type="button" style="--x:0;--y:-1" aria-label="Home">⌂</button><button type="button" style="--x:.87;--y:-.5" aria-label="Search">⌕</button><button type="button" style="--x:.87;--y:.5" aria-label="Favourite">♡</button><button type="button" style="--x:0;--y:1" aria-label="Mail">✉</button><button type="button" style="--x:-.87;--y:.5" aria-label="Settings">⚙</button><button type="button" style="--x:-.87;--y:-.5" aria-label="Profile">☺</button></div>

About this hexagon

A centre hexagon that fans out six surrounding hexagon buttons on hover or keyboard focus.

How it works

Seven buttons share one position and are cut into hexagons with clip-path. The outer six are invisible and small until the group is hovered or holds focus. Each then moves by its own --x and --y multipliers, forming a honeycomb ring around the centre.

Ways to customise it

  • Change the 64px and 60px distances.
  • Swap the symbols for your own icons.
  • Change the centre colour.

Good to know

focus-within keeps the menu open while tabbing through it. On touch screens a tap on the centre button gives it focus and opens the ring, so test it on your devices.

Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.

More in Hexagons

View all →