Skip to content

Commit 20f41c3

Browse files
committed
Add appearance playground
1 parent 2b18563 commit 20f41c3

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#if canImport(AndroidSwiftUI)
2+
import AndroidSwiftUI
3+
#else
4+
import SwiftUI
5+
#endif
6+
7+
struct AppearancePlayground: View {
8+
var body: some View {
9+
ScrollView {
10+
VStack(alignment: .leading, spacing: 0) {
11+
Example("Border") {
12+
Text("Bordered")
13+
.padding()
14+
.border(.blue, width: 2)
15+
}
16+
Example("Shadow") {
17+
RoundedRectangle(cornerRadius: 12)
18+
.fill(.white)
19+
.frame(width: 140, height: 64)
20+
.shadow(radius: 10)
21+
}
22+
Example("Clip to circle") {
23+
Color.blue.frame(width: 80, height: 80).clipShape(Circle())
24+
}
25+
Example("Clip to capsule") {
26+
Text("Capsule")
27+
.padding()
28+
.background(Color.orange)
29+
.clipShape(Capsule())
30+
}
31+
Example("Overlay badge") {
32+
Color.blue
33+
.frame(width: 80, height: 80)
34+
.cornerRadius(12)
35+
.overlay(alignment: .bottomTrailing) {
36+
Circle().fill(.red).frame(width: 26, height: 26)
37+
}
38+
}
39+
Example("Overlay text") {
40+
Color.green
41+
.frame(height: 80)
42+
.cornerRadius(8)
43+
.overlay {
44+
Text("Centered overlay").foregroundColor(.white).bold()
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)