main
swift 25 lines 731 Bytes
Raw
1 import SwiftUI
2
3 struct KleponCard<Content: View>: View {
4 let padding: CGFloat
5 @ViewBuilder var content: Content
6
7 init(padding: CGFloat = 18, @ViewBuilder content: () -> Content) {
8 self.padding = padding
9 self.content = content()
10 }
11
12 var body: some View {
13 content
14 .padding(padding)
15 .frame(maxWidth: .infinity, alignment: .leading)
16 .background(
17 RoundedRectangle(cornerRadius: 24, style: .continuous)
18 .fill(KleponColor.surface)
19 )
20 .overlay(
21 RoundedRectangle(cornerRadius: 24, style: .continuous)
22 .stroke(KleponColor.divider, lineWidth: 1)
23 )
24 }
25 }