<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/paletteSelectionEffect(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE22paletteSelectionEffectyQrAA07PaletteeF0VF"
  },
  "title" : "paletteSelectionEffect(_:)"
}
-->

# paletteSelectionEffect(_:)

Specifies the selection effect to apply to a palette item.

```
nonisolated func paletteSelectionEffect(_ effect: PaletteSelectionEffect) -> some View
```

## Parameters

`effect`

The type of effect to apply when a palette item is selected.

## Discussion

[`automatic`](/documentation/SwiftUI/PaletteSelectionEffect/automatic) applies the system’s default
appearance when selected. When using un-tinted SF Symbols or template
images, the current tint color is applied to the selected items’ image.
If the provided SF Symbols have custom tints, a stroke is drawn around selected items.

If you wish to provide a specific image (or SF Symbol) to indicate
selection, use [`custom`](/documentation/SwiftUI/PaletteSelectionEffect/custom) to forgo the system’s
default selection appearance allowing the provided image to solely
indicate selection instead.

The following example creates a palette picker that disables the
system selection behavior:

```
Menu {
    Picker("Palettes", selection: $selection) {
        ForEach(palettes) { palette in
            Label(palette.title, image: selection == palette ?
                  "selected-palette" : "palette")
            .tint(palette.tint)
            .tag(palette)
        }
    }
    .pickerStyle(.palette)
    .paletteSelectionEffect(.custom)
} label: {
    ...
}
```

If a specific SF Symbol variant is preferable instead, use
[`symbolVariant(_:)`](/documentation/SwiftUI/PaletteSelectionEffect/symbolVariant(_:)).

```
Menu {
    ControlGroup {
        ForEach(ColorTags.allCases) { colorTag in
            Toggle(isOn: $selectedColorTags[colorTag]) {
                Label(colorTag.name, systemImage: "circle")
            }
            .tint(colorTag.color)
        }
    }
    .controlGroupStyle(.palette)
    .paletteSelectionEffect(.symbolVariant(.fill))
}
```

---

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)