A lightweight SwiftUI popup card component which displays a popup just like a sheet but with some animations (rotation 3d effects).
To add CardPopupView to your project: Add the repository URL to your project’s package dependencies.
struct ContentView: View {
@State var isCardPresented: Bool = false
@State var backgroundGradient: LinearGradient = .init(colors: [.black, .white], startPoint: .top, endPoint: .bottom)
var body: some View {
VStack {
}
.cardPopupView(
isPresented: $isCardPresented,
backgroundType: .gradient(backgroundGradient)
) {
Text("Popup view content")
}
}
}
The background of the popup can be customized and can be set to a solid color or a gradient.
To use a solid color use:
backgroundType: .solid(.black)
To use a gradient color use:
backgroundType: .gradient(backgroundGradient)