<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/SymbolVariants",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI14SymbolVariantsV"
  },
  "title" : "SymbolVariants"
}
-->

# SymbolVariants

A variant of a symbol.

```
struct SymbolVariants
```

## Overview

Many of the
<doc://com.apple.documentation/design/Human-Interface-Guidelines/sf-symbols>
that you can add to your app using an [`Image`](/documentation/SwiftUI/Image) or a [`Label`](/documentation/SwiftUI/Label) instance
have common variants, like a filled version or a version that’s
contained within a circle. The symbol’s name indicates the variant:

```
VStack(alignment: .leading) {
    Label("Default", systemImage: "heart")
    Label("Fill", systemImage: "heart.fill")
    Label("Circle", systemImage: "heart.circle")
    Label("Circle Fill", systemImage: "heart.circle.fill")
}
```

![A screenshot showing an outlined heart, a filled heart, a heart in](images/com.apple.SwiftUI/SymbolVariants-1@2x.png)

You can configure a part of your view hierarchy to use a particular variant
for all symbols in that view and its child views using `SymbolVariants`.
Add the [`symbolVariant(_:)`](/documentation/SwiftUI/View/symbolVariant(_:)) modifier to a view to set a variant
for that view’s environment. For example, you can use the modifier to
create the same set of labels as in the example above, using only the
base name of the symbol in the label declarations:

```
VStack(alignment: .leading) {
    Label("Default", systemImage: "heart")
    Label("Fill", systemImage: "heart")
        .symbolVariant(.fill)
    Label("Circle", systemImage: "heart")
        .symbolVariant(.circle)
    Label("Circle Fill", systemImage: "heart")
        .symbolVariant(.circle.fill)
}
```

Alternatively, you can set the variant in the environment directly by
passing the [`symbolVariants`](/documentation/SwiftUI/EnvironmentValues/symbolVariants) environment value to the
[`environment(_:_:)`](/documentation/SwiftUI/View/environment(_:_:)) modifier:

```
Label("Fill", systemImage: "heart")
    .environment(\.symbolVariants, .fill)
```

SwiftUI sets a variant for you in some environments. For example, SwiftUI
automatically applies the [`fill`](/documentation/SwiftUI/SymbolVariants/fill-swift.type.property)
symbol variant for items that appear in the `content` closure of the
[`swipeActions(edge:allowsFullSwipe:content:)`](/documentation/SwiftUI/View/swipeActions(edge:allowsFullSwipe:content:))
method, or as the tab bar items of a [`TabView`](/documentation/SwiftUI/TabView).

## Topics

### Getting symbol variants

[`none`](/documentation/SwiftUI/SymbolVariants/none)

No variant for a symbol.

[`circle`](/documentation/SwiftUI/SymbolVariants/circle-swift.type.property)

A variant that encapsulates the symbol in a circle.

[`square`](/documentation/SwiftUI/SymbolVariants/square-swift.type.property)

A variant that encapsulates the symbol in a square.

[`rectangle`](/documentation/SwiftUI/SymbolVariants/rectangle-swift.type.property)

A variant that encapsulates the symbol in a rectangle.

[`fill`](/documentation/SwiftUI/SymbolVariants/fill-swift.type.property)

A variant that fills the symbol.

[`slash`](/documentation/SwiftUI/SymbolVariants/slash-swift.type.property)

A variant that draws a slash through the symbol.

### Modifying a variant

[`circle`](/documentation/SwiftUI/SymbolVariants/circle-swift.property)

A version of the variant that’s encapsulated in a circle.

[`square`](/documentation/SwiftUI/SymbolVariants/square-swift.property)

A version of the variant that’s encapsulated in a square.

[`rectangle`](/documentation/SwiftUI/SymbolVariants/rectangle-swift.property)

A version of the variant that’s encapsulated in a rectangle.

[`fill`](/documentation/SwiftUI/SymbolVariants/fill-swift.property)

A filled version of the variant.

[`slash`](/documentation/SwiftUI/SymbolVariants/slash-swift.property)

A slashed version of the variant.

### Comparing variants

[`contains(_:)`](/documentation/SwiftUI/SymbolVariants/contains(_:))

Returns a Boolean value that indicates whether the current variant
contains the specified variant.



---

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)