Skip to main content
Rectangle(): Shape;

Support

Usage

Basic rectangle

Rectangle()
    .fill(Color("red"))
    .frame({ width: 200, height: 100 })

Rectangle with border

Rectangle()
    .stroke({ style: Color("black"), lineWidth: 2 })
    .frame({ width: 150, height: 75 })

Filled rectangle with rounded corners

Rectangle()
    .fill(Color("purple"))
    .cornerRadius(10)
    .frame({ width: 120, height: 80 })