React hook for handling swipe gestures on touch devices and mouse interactions with comprehensive directional callbacks and customizable sensitivity settings
90
Evaluation — 90%
↑ 1.00xAgent success when using this tile
Build a React component that allows users to navigate through images using swipe gestures on touch devices and mouse interactions on desktop browsers.
Create an ImageGallery component that:
The component should accept the following props:
images: An array of image URL stringsinitialIndex: The starting image index (default: 0)onFavoriteToggle: Optional callback function called with the image index when favorited/unfavorited@generates
/**
* A swipeable image gallery component
*/
export function ImageGallery({ images, initialIndex = 0, onFavoriteToggle }) {
// IMPLEMENTATION HERE
}Provides swipe gesture detection for React components.
React library for building user interfaces.
Install with Tessl CLI
npx tessl i tessl/npm-react-swipeabledocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10