Inset Banner
Default
Day | Night |
---|---|
. |
Usage
All text fields in BPKInsetBanner are optional, though it requires having either a logo, title or subheading (or a combination). The background colour is customizable, while the text and info icon's colour rely on the variant.
```swift BPKInsetBanner( title: "Title", subheadline: "Subheading", callToAction: .init( text: "Sponsored", accessibilityLabel: "More Information"), bodyText: "This text shows when tapping the banner", variant: .onDark, backgroundColor: Color(red: 1.000, green: 0.400, blue: 0.004, opacity: 1.000) )
### Inserting logo content
The `logoContent` to be inserted can be any `View` but **it is not recommended to insert anything but an image or a loading indicator**:
swift BPKInsetBanner( logoContent: Image("skyland").resizable().scaledToFit(), title: "Title", subheadline: "Subheading", callToAction: .init( text: "Sponsored", accessibilityHint: "Double tap for more information", showIcon: true), bodyText: "You can change your destination, date of travel," + " or both, with no change fee. Valid for all " + "new bookings made up to 31 May for travel between now and 31 December 2023.", variant: .onDark, backgroundColor: Color(red: 1.000, green: 0.400, blue: 0.004, opacity: 1.000) )
The info icon can be disabled passing the `showIcon` value in `callToAction`:
swift BPKInsetBanner( title: "Title", subheadline: "Subheading", callToAction: .init( text: "Sponsored", accessibilityLabel: "More Information", showIcon: false), bodyText: "This text shows when tapping the banner", variant: .onDark, backgroundColor: Color(red: 1.000, green: 0.400, blue: 0.004, opacity: 1.000) ) ```