Sachin Kumar

SmoothRoundedRectangle

Figma-smooth corner rounding for SwiftUI.

View on GitHub

A custom SwiftUI Shape that mimics Figma’s smooth corner rounding. Control smoothness from 0 (circular) to 1 (fully smooth), pick which corners to round, and go beyond half-size radii - just like in Figma.

Open source · MIT · Swift

Features

Parametric Smoothness

Set smoothness anywhere between 0 and 1 for continuous, Figma-like corners.

Per-Corner Control

Apply uniform radii, selected corners, or different radii on each corner.

clipShape Ready

Use it as a fillable shape or clip any view with the same smooth geometry.

Figma Parity

Designed to match Figma’s corner smoothing, including radii larger than half the shorter side.

Usage

Uniform radius with smoothing

SmoothRoundedRectangle(radius: 80, style: .smooth(1))
    .fill(.cyan)
    .frame(width: 240, height: 240)

Selected corners

SmoothRoundedRectangle(radius: 80, corners: [.topLeading, .bottomTrailing])
    .fill(.green)
    .frame(width: 240, height: 80)

Different radii per corner

SmoothRoundedRectangle(
    topLeadingRadius: 80,
    bottomLeadingRadius: 80,
    bottomTrailingRadius: 20,
    topTrailingRadius: 20,
    style: .continuous
)
.frame(width: 240, height: 120)