<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/HoverEffectContent/clipShape(_:style:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI18HoverEffectContentPAAE9clipShape_5styleQrqd___AA9FillStyleVtAA0G0Rd__lF"
  },
  "title" : "clipShape(_:style:)"
}
-->

# clipShape(_:style:)

Sets a clipping shape for the view.

```
func clipShape<S>(_ shape: S, style: FillStyle = FillStyle()) -> some HoverEffectContent where S : Shape
```

## Parameters

`shape`

The clipping shape to use for the view. The `shape` fills
the view’s frame, while maintaining its aspect ratio.

`style`

The fill style to use when rasterizing `shape`.

## Return Value

An effect that sets the clip shape of a view.

## Discussion

Use `clipShape(_:style:)` to clip the view’s rendered output to the
provided shape. By applying a clipping shape, you preserve the parts
of the view covered by the shape, while eliminating other parts of
the view. The clipping shape itself isn’t visible.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)