interactive-hit-areas

millionco/skills · Agent Skill

Utilizzare quando gli elementi interattivi con una distanza visiva tra loro richiedono l'hover o il click per rispondere in tutta l'area senza zone morte.

Vai all'installazione ↓

Panoramica

AutoremillioncoOrganizzazione
Repositorymillionco/skills ↗
Cartella dello skillinteractive-hit-areas
Stelle34
Fork2
File inclusi1
LicenzaMIT
Aggiornato30 giugno 2026
LinkSorgente dello skill ↗ · Repository ↗

Verifica Mozgi

Cosa abbiamo trovato nei file dello skill. I dettagli con l’abbonamento.

Sicurezza
rischio basso · nessun rischio evidente — il report completo mostra i dettagli
Compatibilità
solo istruzioni — funziona con la maggior parte degli agenti
Skill simili
31 skill simili trovati
Inoltre con l’abbonamento

Installazione

Uno skill è una cartella con un file SKILL.md. Scegli il tuo agente ed esegui i comandi in un terminale (macOS, Linux o Git Bash su Windows) dalla radice del progetto.

Incolla il prompt in Claude, Codex o un altro assistente: controllerà lo skill e lo installerà.

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.

File dello skill

1 file Scarica ZIP

Leggi SKILL.md e i file correlati prima di installare. Clicca un file per l'anteprima.

Contenuto di SKILL.md

Testo originale dell'autore · sola lettura

Interactive 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, or margin between 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-N between hover/click items with gap-0 (flush) and move the spacing inside each item (padding, or a centered child with max-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-1 on both keeps centers aligned.
  • For lists/menus: put vertical rhythm as py-* on each row, not as space-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.

Domande frequenti

Che cosa fa lo skill interactive-hit-areas?

Utilizzare quando gli elementi interattivi con una distanza visiva tra loro richiedono l'hover o il click per rispondere in tutta l'area senza zone morte.

Come si installa interactive-hit-areas?

Apri il blocco “Installazione” in questa pagina e scegli il tuo agente — Claude Code, Codex, Cursor o Gemini CLI — per i comandi pronti che copiano la cartella dello skill nel posto giusto. Oppure copia il prompt dalla scheda “Con l'assistente” e lascia che sia l'assistente a controllare e installare lo skill.

Con quali modelli AI funziona interactive-hit-areas?

Gli skill sono semplici istruzioni in Markdown (formato Agent Skills), quindi interactive-hit-areas funziona con qualsiasi agente che legge SKILL.md: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode e altri. Il modello carica le istruzioni solo quando il compito corrisponde alla descrizione dello skill.

interactive-hit-areas è gratuito?

Lo skill è pubblicato apertamente da millionco con licenza MIT. Lo skill in sé non costa nulla: paghi solo il tuo fornitore AI per i token usati.

È sicuro installare gli skill?

Uno skill è un insieme di istruzioni che il tuo agente seguirà: leggi SKILL.md e i file correlati prima di installarlo. Gli script nella cartella dello skill vengono eseguiti solo se li esegue l'agente: controlla cosa fa e non concedere permessi superflui.

In cosa differisce uno skill da un server MCP o da un plugin?

Un server MCP o un plugin danno al modello nuovi strumenti: codice che viene eseguito e restituisce un risultato. Uno skill fornisce conoscenza e metodo: come affrontare il compito, quali passi seguire e com'è un buon risultato. Non servono server né chiavi API.

Skill correlati

Tutti gli skill →
frontend-ui-engineering Guida all'ingegneria frontend UI che copre l'architettura dei componenti, il design responsivo, l'accessibilità e i modelli di implementazione manutenibili. addyosmani111k wcag-audit-patterns Eseguite audit di accessibilità WCAG 2.2 con test automatizzati, verifica manuale e raccomandazioni di correzione, utilizzateli per audit di siti web accessibili, correzione di violazioni WCAG o implementazione di modelli di design accessibili. wshobson41.8k wcag-audit-patterns Uno strumento per condurre audit di accessibilità WCAG 2.2 sui siti web, fornendo test automatizzati, verifiche manuali e linee guida pratiche per correggere le violazioni e garantire interfacce inclusive. wshobson41.5k fixing-accessibility Eseguire un audit e correggere i problemi di accessibilità HTML, inclusi i tag ARIA, la navigazione con la tastiera, la gestione del focus, il contrasto dei colori e gli errori dei form, utilizzando gli standard WCAG quando si aggiungono elementi di controllo interattivi, form, dialoghi o durante la verifica della conformità. ibelick10.2k better-accessibility Controlla e migliora gli stati di focus, il supporto alla tastiera, ARIA, i moduli, i programmi di lettura dello schermo, le aree di destinazione e l'accessibilità del movimento. jakubkrehel8.6k better-colors Spazio dei colori OKLCH per progetti web, converte hex/rgb/hsl in oklch, genera palette, controlla il contrasto, gestisce i limiti del range di colori e crea temi con Tailwind v4, funziona con oklch, conversione dei colori, generazione di palette, rapporto di contrasto, range di colori, display p3, token di design, drift del tono, croma, colori del tema scuro jakubkrehel8.6k