Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
Protocol

Shape

The Compose SwiftUI form of SwiftUI's Shape.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
interface Shape

Overview

This is the Kotlin form of SwiftUI Shape: SwiftUI documentation. In Swift it reads:

nonisolated protocol Shape : Sendable, Animatable, View

Topics

Type properties

val buttonBorder: ButtonBorderShape
SwiftUI Shape.buttonBorder
val textInputBorder: TextInputBorderShape
SwiftUI Shape.textInputBorder · iOS 27.0+, macOS 27.0+, tvOS 27.0+, watchOS 27.0+
val containerRelative: ContainerRelativeShape
SwiftUI Shape.containerRelative
val circle: Circle
SwiftUI Shape.circle
val capsule: Capsule
SwiftUI Shape.capsule
val ellipse: Ellipse
SwiftUI Shape.ellipse
val rect: Rectangle
SwiftUI Shape.rect

Methods

fun rect(cornerSize: CGSize, style: RoundedCornerStyle = RoundedCornerStyle.continuous): RoundedRectangle
SwiftUI Shape.rect(cornerSize:style:)
fun rect(cornerRadius: Double, style: RoundedCornerStyle = RoundedCornerStyle.continuous): RoundedRectangle
SwiftUI Shape.rect(cornerRadius:style:)
fun rect(topLeadingCorner: Edge.Corner.Style, topTrailingCorner: Edge.Corner.Style, bottomLeadingCorner: Edge.Corner.Style, bottomTrailingCorner: Edge.Corner.Style): ConcentricRectangle
SwiftUI Shape.rect(topLeadingCorner:topTrailingCorner:bottomLeadingCorner:bottomTrailingCorner:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun rect(corners: Edge.Corner.Style, isUniform: Boolean = false): ConcentricRectangle
SwiftUI Shape.rect(corners:isUniform:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun rect(cornerRadii: RectangleCornerRadii, style: RoundedCornerStyle = RoundedCornerStyle.continuous): UnevenRoundedRectangle
SwiftUI Shape.rect(cornerRadii:style:)
fun rect(topLeadingRadius: Double = 0.0, bottomLeadingRadius: Double = 0.0, bottomTrailingRadius: Double = 0.0, topTrailingRadius: Double = 0.0, style: RoundedCornerStyle = RoundedCornerStyle.continuous): UnevenRoundedRectangle
SwiftUI Shape.rect(topLeadingRadius:bottomLeadingRadius:bottomTrailingRadius:topTrailingRadius:style:)
fun capsule(style: RoundedCornerStyle): Capsule
SwiftUI Shape.capsule(style:)

Types

interface Shape
SwiftUI Shape