OCInformationCardSliderView: UI Component
The OCInformationCardSlider iis an adaptable slideshow that allows us to incorporate any view. This versatile display includes a slider and a page indicator to show the current page.
Features
- User can pass the desired details to show card slider:
Parameters:
cards: Array of cardsstyle: The appearance of the card can be customized using different colors and spacing.selectedIndex: Selected index while launching the pageshowPageIndicator: Make false if we don't want to page indicator along with slider
Style Parameters:
selectedIndicatorColor: Indicator selected colorunselectedIndicatorColor: Indicator unselected colorcardSpacing: Spacing between cardsnextCardPadding: What portion of the next card is currently visible on the screenpageControlSpacing: Spacing of page Indicator from slider
import SwiftUI
struct OCInformationCardSliderTemplate: View {
let card = OCInformationCardView(description: "Description", caption: "Bold caption", icon: Image("LargeIcon"), buttonText: "Button", informationCardViewStyle: OCInformationCardViewStyle(iconType: .large))
var body: some View {
VStack {
OCInformationCardSliderView(cards: [AnyView(card), AnyView(card), AnyView(card)], selectedIndex: 1)
}
}
}