Skip to main content
Clipping and masking modifiers control which parts of a component are visible. clipped trims content to the component’s rectangular bounds; clipShape clips to any Shape — circle, capsule, rounded rectangle; mask uses an image’s luminance to drive transparency. clipShape clips both visuals and hit testing, so taps land only inside the shape. To change just the hit area without altering visuals, see contentShape. For overall transparency, see opacity.

clipped

Clips a component’s content to its bounding frame.
Clip overflowing content
Clip after aspect ratio fill
clipped() clips to the component’s rectangular bounds. For clipping to a custom shape, use clipShape instead.

clipShape

Clips a component’s content to a specific shape.
shape
Shape
required
The shape to clip to. Common shapes include Circle(), Capsule(), RoundedRectangle(cornerRadius), Rectangle(), and Ellipse().
Clip an image to a circle
Clip to a rounded rectangle
Clip to a capsule
clipShape clips both the visual content and the hit-testing area. To change only the hit-testing shape without clipping visuals, use contentShape.

mask

Masks the component using an image, controlling which areas are visible.
image
Image
required
The image used as a mask. White areas show the underlying content, black areas hide it. Gray values produce partial transparency.
Masking with an image
Gradient fade using a shape mask
The mask image’s luminance determines visibility: white (or light) areas show the content, black (or dark) areas hide it. On web, this is implemented using CSS mask-image.

See also

  • contentShape — change the hit-testing shape without clipping visuals
  • cornerRadius — round the corners of a component
  • opacity — control overall transparency
  • overlay — layer a component on top