Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/prefetch-hit-slop.md
1---2title: Use hitSlop to Trigger Predictions Earlier3impact: MEDIUM4tags: prefetch, hit-slop, target5---67## Use hitSlop to Trigger Predictions Earlier89Expand the invisible prediction area around elements with hitSlop to start loading sooner.1011**Incorrect (tight prediction area):**1213```tsx14const { elementRef } = useForesight({15callback: () => prefetch(),16hitSlop: 0,17});18```1920**Correct (expanded prediction area):**2122```tsx23const { elementRef } = useForesight({24callback: () => prefetch(),25hitSlop: 20,26});27```28