Skip to main content
.contentShape(shape: Shape): Component;

Parameters

shape
Shape
The shape that defines the interactive area for hit testing. Can be any shape component like Circle, Rectangle, RoundedRectangle, etc.

Support

Usage

Expand tappable area

Text("Small text")
    .contentShape(Rectangle())
    .frame({ width: 100, height: 100 })
    .onTapGesture(() => {
        console.log("Tapped!")
    })