Hanzo AI Studio
Your workspace for AI model experimentation, prompt engineering, and creating agent-based applications.
MODELS
SAVED PROJECTS
Welcome to Hanzo AI Studio. How can I help you today?
I need to create a React component that renders a carousel
Sure! Here's a simple React carousel component using Framer Motion:
jsx
import { motion, AnimatePresence } from 'framer-motion';
import { useState } from 'react';
const Carousel = ({ images }) => {
const [currentIndex, setCurrentIndex] = useState(0);
const handleNext = () => {
setCurrentIndex((prevIndex) =>
prevIndex === images.length - 1 ? 0 : prevIndex + 1
);
};
const handlePrevious = () => {
setCurrentIndex((prevIndex) =>
prevIndex === 0 ? images.length - 1 : prevIndex - 1
);
};
return (
);
};
export default Carousel;
This component takes an array of image URLs and displays them one at a time with animated transitions. You can customize it further based on your specific needs.25% of compute revenue goes to open source contributors. Connect your GitHub & wallet to earn.
Connect & EarnGet started with AI Studio
Open source
License: Apache-2.0hanzoai