Subgrid Beam
Three actions on a single subgrid track with a luminous beam underline that physically moves between buttons on hover, drawn with a single shared pseudo-element.
Subgrid Beam the 2nd of 22 designs in the 22 CSS Button Group Designs collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.
Live preview
The code
<div class="cbgp-beam" role="group" aria-label="Document actions"> <button type="button">Edit</button> <button type="button">Duplicate</button> <button type="button">Archive</button> </div>
.cbgp-beam {
display: inline-grid;
grid-template-columns: repeat(3, minmax(96px, 1fr));
position: relative;
background: rgba(8,10,18,0.85);
border: 1px solid rgba(255,255,255,0.06);
border-radius: 12px;
overflow: hidden;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 22px rgba(0,0,0,0.45);
}
.cbgp-beam::before {
content: '';
position: absolute;
bottom: 0; left: 0;
width: 33.333%; height: 2px;
background: linear-gradient(90deg, transparent, #00ffe0 30%, #ff5af1 70%, transparent);
filter: blur(0.4px);
transition: transform 0.45s cubic-bezier(.65,0,.35,1);
pointer-events: none;
}
.cbgp-beam button {
padding: 11px 18px;
border: 0; cursor: pointer;
background: transparent;
color: rgba(220,225,230,0.65);
font: 600 12px/1 ui-sans-serif, system-ui;
letter-spacing: 0.04em;
transition: color 0.25s, background 0.25s;
}
.cbgp-beam button + button { border-left: 1px solid rgba(255,255,255,0.04); }
.cbgp-beam button:hover { color: #fff; background: rgba(0,255,224,0.04); }
.cbgp-beam:has(button:nth-child(2):hover)::before { transform: translateX(100%); }
.cbgp-beam:has(button:nth-child(3):hover)::before { transform: translateX(200%); }
.cbgp-beam button:focus-visible { outline: 2px solid #00ffe0; outline-offset: -2px; }