| Choose between debounce, throttle, or rAF for an event |
Debounce and Throttle |
| Trap focus in a modal, implement roving tabindex |
Keyboard Navigation Craft |
| Set up IntersectionObserver, scroll-linked state, infinite scroll |
Scroll Interaction Patterns |
| Build drag-and-drop with touch support and keyboard equivalent |
Drag and Drop Craft |
| Update UI immediately before server confirms |
Optimistic UI |
| Detect swipes, pinch, long-press on touch devices |
Touch and Gesture Craft |
| Copy to clipboard with visual feedback |
Clipboard and Copy Patterns |
| Decide when to validate, build autosave, inline editing |
Form Interaction Craft |
| Sequence, cancel, or coordinate JS animations |
Animation Orchestration |
| Avoid layout thrashing, prevent memory leaks, break up long tasks |
Performance and Event Handling |