---
title: role
framework: swiftui
role: symbol
role_heading: Type Property
path: swiftui/shape/role
---

# role

An indication of how to style a shape.

## Declaration

```swift
nonisolated static var role: ShapeRole { get }
```

## Discussion

Discussion SwiftUI looks at a shape’s role when deciding how to apply a ShapeStyle at render time. The Shape protocol provides a default implementation with a value of ShapeRole.fill. If you create a composite shape, you can provide an override of this property to return another value, if appropriate.
