interactive-hit-areas
millionco/skills · Agent Skill
Use when interactive elements with visual spacing between them need hover or click to respond across the whole region with no dead zones.
Jump to install ↓Overview
| Publisher | |
|---|---|
| Repository | millionco/skills ↗ |
| Skill folder | interactive-hit-areas |
| Stars | 34 |
| Forks | 2 |
| Bundled files | 1 |
| License | MIT |
| Last updated | June 30, 2026 |
| Links | Skill source ↗ · Repository ↗ |
Mozgi check
What we found in the skill files. Details come with a subscription.
Installation
A skill is a folder with a SKILL.md file. Pick your agent and run the commands in a terminal (macOS, Linux or Git Bash on Windows) from your project root.
Copy the prompt into Claude, Codex or another assistant: it will review the skill and install it for you.
Install the “interactive-hit-areas” skill from mozgi.io (https://mozgi.io/skills/millionco-interactive-hit-areas/) for me. 1. Download the archive: https://mozgi.io/skills/millionco-interactive-hit-areas/download If it fails, take the skill folder from the source: https://github.com/millionco/skills/tree/main/skills/interactive-hit-areas 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “interactive-hit-areas” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/interactive-hit-areas/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .claude/skills cp -r /tmp/skills/skills/interactive-hit-areas .claude/skills/interactive-hit-areas
Restart Claude Code — the skill appears in the list; call it manually with /interactive-hit-areas. For all projects use ~/.claude/skills.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .agents/skills cp -r /tmp/skills/skills/interactive-hit-areas .agents/skills/interactive-hit-areas
Codex looks for skills in .agents/skills from the current folder up to the repo root; call one with /skills or $interactive-hit-areas. For all projects use ~/.agents/skills.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .cursor/skills cp -r /tmp/skills/skills/interactive-hit-areas .cursor/skills/interactive-hit-areas
Cursor picks the skill up on start; call it with “/” in Agent chat. Cursor also reads .claude/skills and .agents/skills. For all projects use ~/.cursor/skills.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .gemini/skills cp -r /tmp/skills/skills/interactive-hit-areas .gemini/skills/interactive-hit-areas
Gemini CLI offers to activate the skill when a task matches — you approve it. For all projects use ~/.gemini/skills.
Read SKILL.md and any companion files before deciding whether to install. Click a file to preview it.
SKILL.md contents
Original author text · read-onlyInteractive Hit Areas
Separate the hit area (where pointer events land) from the visual area (what the user sees). Bugs happen when spacing is built so that the gap between items has no event handler — the pointer falls into a dead zone and hover/click does nothing or flickers.
The core rule
Visual spacing between interactive siblings must live INSIDE each hit target, never BETWEEN them.
- WRONG: spacing via
gap,space-x, ormarginbetween the interactive elements. The space is empty DOM — no handler — so it's dead. - RIGHT: interactive elements sit flush (no gap), each filling its full slot and carrying the handler; the visual element inside is made narrower/inset (padding,
max-width, or a centered child) so it still *looks* spaced.
Result: the entire region is a continuous strip of live targets, but it looks identical to the spaced design.
Symptom & detection
- Symptom: moving the pointer slowly between two items, the highlight blinks off in the space between them, or you must aim directly at the small visual element to trigger it.
- Detect: sweep the cursor horizontally/vertically across the whole component. If the active/hover state ever drops out while still inside the component's bounds, you have dead zones.
- The bigger the visual gap, the bigger the dead zone — so "nice airy spacing" makes it worse.
The fix (general)
1. Identify the repeating slot (one item's full share of the axis — its *pitch*).
2. Make the interactive container fill that whole slot, flush against its neighbors (remove gap/space-*/margin between siblings; use flex-1/equal grid tracks).
3. Put the handler (onMouseEnter, onClick, :hover) on that full-slot container.
4. Recreate the visual spacing *inside*: center a narrower visual element (max-width, fixed width + items-center), or use padding on the container around full-bleed content. Padding is part of the element, so it stays a live target; margin/gap is not.
React / Tailwind specifics
- Replace
gap-Nbetween hover/click items withgap-0(flush) and move the spacing inside each item (padding, or a centered child withmax-w-[Npx]). - Keep sibling rows that must stay column-aligned (e.g. bars and their labels/icons) on the same gap setting — if one row is flush and another has
gap, their centers drift apart. Flush +flex-1on both keeps centers aligned. - For lists/menus: put vertical rhythm as
py-*on each row, not asspace-y-*/gap-*between rows, when the whole row strip should be clickable. - Accessibility tie-in: this is also how you hit the 24–44px minimum target size — grow the hit area with padding while keeping the glyph small.
Worked example (bar chart)
Spaced bars where hovering anywhere over a bar's column highlights it:
// Container: flush columns, NO gap — the whole width is live.
<div className="absolute inset-0 flex items-stretch">
{bars.map((bar, i) => (
<div
key={bar.id}
// flex-1 = one full slot/pitch; full height = hover above the bar too
className="flex flex-1 flex-col items-center justify-end"
onMouseEnter={() => setHovered(i)}
onMouseLeave={() => setHovered(null)}
style={{ opacity: hovered !== null && hovered !== i ? 0.4 : 1 }}
>
<span>{bar.value}</span>
{/* visual spacing comes from the narrower CENTERED bar, not a gap */}
<div className="w-full" style={{ maxWidth: 37, height: bar.value * UNIT }} />
</div>
))}
</div>
Anti-pattern that caused the bug: flex ... gap-2 with w-full bars. The bars touched their slots, so the only spacing was the 8px gap between columns — and that gap was dead to the pointer.
When gaps between items ARE fine
Dead zones only matter when you want "anywhere in the region targets the nearest item." If items are meant to be discrete and the space between them is genuinely inert (e.g. cards on a page, unrelated buttons), gap is correct — don't force flush layouts everywhere. Apply this skill when the design intends a continuous interactive band with visual separation.
Frequently asked questions
What does the interactive-hit-areas skill do?
Use when interactive elements with visual spacing between them need hover or click to respond across the whole region with no dead zones.
How do I install interactive-hit-areas?
Open the “Installation” block on this page and pick your agent — Claude Code, Codex, Cursor or Gemini CLI — for ready-made commands that copy the skill folder to the right place. Or copy the prompt from the “Via assistant” tab and let the assistant review and install the skill.
Which AI models work with interactive-hit-areas?
Skills are plain Markdown instructions (the Agent Skills format), so interactive-hit-areas works with any agent that reads SKILL.md: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and more. The model loads the instructions only when a task matches the skill's description.
Is interactive-hit-areas free?
The skill is published openly by millionco under the MIT license. The skill itself costs nothing — you only pay your AI provider for the tokens you use.
Is it safe to install skills?
A skill is a set of instructions your agent will follow, so read SKILL.md and its companion files before installing. Scripts in the skill folder only run if your agent runs them — keep an eye on what it does and do not grant unnecessary permissions.
How is a skill different from an MCP server or a plugin?
An MCP server or plugin gives the model new tools — code that runs and returns a result. A skill gives it knowledge and process: how to approach a task, which steps to follow and what good output looks like. It needs no server or API key.