- Welcome
- Getting started
- Latest updates
- Foundations
-
Components
- Accordion
- Alert
- Alignment
- App Search Modal
- Aria live
- Autosuggest
- Badge
- Banner alert
- Bar chart
- Blockquote
- Bottom navigation
- Bottom sheet
- Breadcrumb
- Breakpoint
- Button
- Calendar
- Card
- Card list
- Card button
- Carousel
- Checkbox
- Chip
- Chip group
- Code
- Content cards
- Data Table
- Datepicker
- Description list
- Dialog
- Divider
- Drawer
- Field Set
- Flare
- Flat list
- Flight leg
- Floating action button
- Floating notification
- Form label
- Form validation
- Graphic promotion
- Horizontal navigation
- Icon
- Image
- Image Gallery
- Infinite scroll
- Info Banner
- Inset Banner
- Link
- List
- Map
- Mobile scroll container
- Modal
- Navigation bar
- Navigation Tab Group
- Nudger
- Overlay
- Page indicator
- Pagination
- Panel
- Phone input
- Picker
- Popover
- Price
- Progress bar
- Radio button
- Rating
- Rating Bar
- Scrollable calendar
- Search Modal
- Section header
- Section list
- Select
- Skeleton
- Skip link
- Slider
- Snackbar
- Snippet
- Spinner
- Split input
- Star rating
- Swap Button
- Switch
- Table
- Text
- Text input
- Theming
- Ticket
- Toast
- Tooltip
- Touchable native feedback
- Touchable overlay
- Search Input Summary
- Content
- Accessibility
- Contributing
- Localisation
Overlay
Overlays are a semi-transparent layer between an image and text to make copy easier to read.
Backpack-SwiftUI/Overlay
Solid
Requires a level to be set.
Day | Night |
---|---|
Image("image")
.resizable()
.frame(width: 200, height: 200)
.bpkOverlay(.solid(.high))
.cornerRadius(8)
Linear
Requires a level to be set, as well as a direction.
Image("image")
.resizable()
.frame(width: 200, height: 200)
.bpkOverlay(.linear(.high, .leading))
.cornerRadius(8)
Top
Day | Night |
---|---|
Bottom
Day | Night |
---|---|
Leading
Day | Night |
---|---|
Trailing
Day | Night |
---|---|
Vignette
Image("image")
.resizable()
.frame(width: 200, height: 200)
.bpkOverlay(.vignette)
.cornerRadius(8)
Day | Night |
---|---|
Usage
BPKOverlay provides the bpkOverlay(BPKOverlayType) View modifier that can be used to add an overlay to any view.
import Backpack_SwiftUI
var body: some View {
Image("image")
.resizable()
.frame(width: 200, height: 200)
.bpkOverlay(.solid(.high))
.cornerRadius(8)
}
Made with ❤️ by Skyscanner © 2024
© 2024 Skyscanner Backpack. Page last updated on Mar 20, 2023, 10:56