Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anbalagand/carouselview

This library simplifies the implementation of carousel-style interfaces in SwiftUI applications while maintaining smooth, infinite scrolling functionality.
https://github.com/anbalagand/carouselview

carousel carouselview infinite-scroll ios slide slider slideview spm swift swiftui tabvi tabview-swiftui

Last synced: about 1 month ago
JSON representation

This library simplifies the implementation of carousel-style interfaces in SwiftUI applications while maintaining smooth, infinite scrolling functionality.

Awesome Lists containing this project

README

        

This library simplifies the implementation of carousel-style interfaces in SwiftUI applications while maintaining smooth, infinite scrolling functionality.

![CarouselView](Screenshot/CarouselView.gif)

## Features
♾️ Infinite scrolling support

🎯 Selected item tracking

πŸ“ Configurable item spacing

πŸ“ Current index monitoring

⚑️ Native SwiftUI implementation

## Swift Package manager (SPM)
CarouselView is available through [SPM](https://github.com/AnbalaganD/CarouselView). Use below URL to add as a dependency

```swift
dependencies: [
.package(url: "https://github.com/AnbalaganD/CarouselView", .upToNextMajor(from: "1.0.0"))
]
```

## Usage
```swift
import CarouselView

struct ContentView: View {
private let items: [String] = ["One", "Two", "Three", "Four", "Five"]
@State private var selectedIndex: Int = 2

var body: some View {
CarouselView(
items,
spacing: 10.0,
selectedIndex: $selectedIndex
) { item in
Text(item)
.frame(maxWidth: .infinity)
.frame(height: 200)
.background(Color.gray)
.clipShape(RoundedRectangle(cornerSize: .init(width: 5, height: 5)))
}
}
}
```

## Author

[Anbalagan D](mailto:[email protected])

## License

CarouselView is available under the MIT license. See the [LICENSE](LICENSE) file for more info.