Delaying tooltips with CSS instead of component state
A narrow icon sidebar has no room for labels, so the existing accessible-but-hidden text was going to be surfaced as a tooltip on a "long hover" — a desktop cursor resting on the element for roughly three seconds.
The first implementation followed the familiar path in a React codebase: model visibility as state, reflect it in the DOM via a class name, drive the default as hidden, flip it to visible after the cursor has been inside the element for more than three seconds, and reset (or keep) it hidden on exit. The state lives through mouseenter and mouseleave handlers.
JS-managed state does open some doors, but here it was overkill. The mouseenter/mouseleave pair is also somewhat finicky, and the entire behaviour fits in the CSS already being written, with less code.
Timing the reveal in CSS
The React UI stays; the state management goes. What remains is a transition-delay: 3s applied while the .icon is :hover. Unhovered, the delay is zero, so the tooltip disappears the moment the cursor leaves. A long hover becomes a one-liner:
.thing {
transition: 0.2s;
}
.thing:hover {
transition-delay: 3s; /* delay hover animation only ON, not OFF */
}
It works well.
The touch-only gap
Cursor-less users are the remaining hole. Screen readers already have the accessible text, and desktop browsers get the custom tooltip, but touch-only screens may never expose the icon labels. A large-screen, cursor-assuming build made that acceptable, though it isn't a dead end: on a link the :hover may fire on first tap, and if the destination has a clear title that can supply enough context. Handling touch events in JavaScript remains an option.



