Overview
Carousel is a production-ready carousel resource included in the sunpeak framework. It displays places or items in a horizontal scrolling carousel with card components, featuring navigation arrows, edge gradients, and interactive buttons.
The resource retrieves place data from useToolData().output and adapts button sizes based on device capabilities.
Data Structure
CarouselData
The resource expects data in the following format viauseToolData().output:
Array of place objects to display in the carousel.
Unique identifier for the place.
Place name displayed in the card header.
Rating value displayed in the metadata.
Category type displayed in the metadata.
Location displayed in the metadata.
URL to the place image.
Description text displayed in the card body.
Features
Carousel Navigation
Displays cards in a horizontal scrolling carousel with:- Navigation arrows for browsing
- Edge gradients to indicate more content
- Smooth scroll transitions
- Configurable card width (220px default)
- 16px gap between cards
Interactive Cards
Each card includes:- Image display with alt text
- Header with place name
- Metadata showing rating, category, and location
- Description text
- Two action buttons (Visit and Learn More)
Responsive Button Sizing
The resource detects touch capabilities from the host context and automatically adjusts button sizes for easier interaction on touch devices.Safe Area Support
Wraps content in the<SafeArea> component, which automatically applies device safe area padding and viewport height constraints.
Common Use Cases
- Product galleries
- Place recommendations
- Restaurant or venue listings
- Travel destination browsing
- Service provider showcases