Skip to main content
Version: Next

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 cards
  • style : The appearance of the card can be customized using different colors and spacing.
  • selectedIndex : Selected index while launching the page
  • showPageIndicator: Make false if we don't want to page indicator along with slider

Style Parameters:

  • selectedIndicatorColor : Indicator selected color
  • unselectedIndicatorColor : Indicator unselected color
  • cardSpacing : Spacing between cards
  • nextCardPadding : What portion of the next card is currently visible on the screen
  • pageControlSpacing : 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)
}
}
}