Vitamin provides you with the VitaminShadow
enum, which has five possible cases:
.shadow100
.shadow200
.shadow300
.shadow400
.none
To apply a shadow to a view, you can call the vitaminShadow(_ shadow: VitaminShadow)
modifier on this view.
import SwiftUI
import VitaminSwiftUI
struct ShadowsView: View {
var body: some View {
// Rectangle with shadow 200
Rectangle()
.vitaminShadow(.shadow200)
}
}
Notes:
- In case you would like to remove a shadow you added before, you can set the shadow to
.none
.