An interactive, SwiftUI-based paginated View designed for seamless browsing of dynamic content, featuring customizable item spacing, padding, and scale effects.
- Dynamic Content Support: Easily display any array of data.
- Customizable Appearance: Adjust item spacing, padding, and minimum scale factor for non-central items.
- Swipe Gestures: Intuitive navigation through swipe gestures.
- Responsive Design: Adapts smoothly to various device sizes and orientations.
- State-Bound Page Index: Programmatically control the paginated view's current page.
Demo.mp4
Go to File > Swift Packages > Add Package Dependency and add the following URL :
https://github.com/billp/BrowseWheel
Here's a quick start guide to integrate the BrowseWheel into your SwiftUI app:
import SwiftUI
struct ContentView: View {
let items: [YourItemType] = [...]
@State private var page = 0
var body: some View {
CarouselView(
items: items,
page: $page,
spacing: -80,
padding: 50,
minScale: 0.6,
itemsOffset: -50) { item in
YourItemView(item: item)
}
}
}
spacing
: The gap between items.padding
: The padding around each item.minScale
: Scale of items on the sides.
Contributions are welcome! Please fork this repository and submit a pull request with your enhancements.
This project is licensed under the MIT License - see the LICENSE file for details.