.shadowedBorder()

// 2022.02.14
extension View {
    /// โญ๏ธ a border with shadow
    /// ```
    /// view.shadowedBorder()
    /// view.shadowedBorder(.blue)
    /// ```
    func shadowedBorder(_ color: Color = .primary) -> some View {
        overlay {
            Rectangle()
                .stroke(color, lineWidth: 4)
                .shadow(radius: 4)
        }
    }
}

Last updated