<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/HoverEffectGroup/init(id:in:behavior:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI16HoverEffectGroupV2id2in8behaviorACSSSg_AA9NamespaceV2IDVAC8BehaviorVtcfc"
  },
  "title" : "init(id:in:behavior:)"
}
-->

# init(id:in:behavior:)

Creates a new [`HoverEffectGroup`](/documentation/SwiftUI/HoverEffectGroup).

```
init(id: String?, in namespace: Namespace.ID, behavior: HoverEffectGroup.Behavior = .activatesGroup)
```

## Parameters

`id`

An optional id to give the group. If provided, the group will be
uniquely identified by combining the id and the namespace.

`namespace`

The namespace that identifies the group.

`behavior`

How the effect will behave relative to other
effects in the group.

## Return Value

A new HoverEffectGroup

---

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)