layout/DSCardCarousel
DSCardCarousel
layoutHorizontal scrolling carousel of cards with spacing and peek effect.
iOSmacOS
Purpose
Use to showcase featured content, products, or cards in a swipeable horizontal layout with visible peek of next card.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| cardsreq | [CardContent] | โ | Array of card content |
| cardWidth | CGFloat | 280 | Width of each card |
| spacing | CGFloat | DSSpacing.md | Space between cards |
Examples
Featured products
Carousel of product cards.
swift
DSCardCarousel(
cards: featuredProducts.map { product in
CardContent(
title: product.name,
subtitle: product.price,
image: product.image
)
},
cardWidth: 300
)Usage Guidelines
- Use for 3-10 featured items
- Cards should have consistent height
- Peek effect encourages horizontal scrolling