The corner radius in points.
Support
Usage
Round a card
Round an image
Pill shape with large radius
Notes
cornerRadius clips the content at the corners. For more control over the clipping shape, use clipShape with a RoundedRectangle.
Rounds the corners of a component.
.cornerRadius(radius: number)
VStack([
Text("Card Title").font("headline"),
Text("Card content goes here.")
])
.padding(16)
.background(Color("white"))
.cornerRadius(12)
Image({ url: "photo.jpg" })
.resizable()
.frame({ width: 100, height: 100 })
.cornerRadius(8)
Text("Tag")
.padding({ leading: 16, trailing: 16, top: 8, bottom: 8 })
.background(Color("blue"))
.foregroundStyle(Color("white"))
.cornerRadius(20)
cornerRadius clips the content at the corners. For more control over the clipping shape, use clipShape with a RoundedRectangle.