---
title: DisclosureGroup
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/disclosuregroup
---

# DisclosureGroup

A view that shows or hides another content view, based on the state of a disclosure control.

## Declaration

```swift
nonisolated struct DisclosureGroup<Label, Content> where Label : View, Content : View
```

## Mentioned in

Displaying data in lists

## Overview

Overview A disclosure group view consists of a label to identify the contents, and a control to show and hide the contents. Showing the contents puts the disclosure group into the “expanded” state, and hiding them makes the disclosure group “collapsed”. In the following example, a disclosure group contains two toggles and an embedded disclosure group. The top level disclosure group exposes its expanded state with the bound property, topLevelExpanded. By expanding the disclosure group, the user can use the toggles to update the state of the toggleStates structure. struct ToggleStates {     var oneIsOn: Bool = false     var twoIsOn: Bool = true } @State private var toggleStates = ToggleStates() @State private var topExpanded: Bool = true

var body: some View {     DisclosureGroup("Items", isExpanded: $topExpanded) {         Toggle("Toggle 1", isOn: $toggleStates.oneIsOn)         Toggle("Toggle 2", isOn: $toggleStates.twoIsOn)         DisclosureGroup("Sub-items") {             Text("Sub-item 1")         }     } }

## Topics

### Creating a disclosure group

- [init(_:content:)](swiftui/disclosuregroup/init(_:content:).md)
- [init(content:label:)](swiftui/disclosuregroup/init(content:label:).md)
- [init(_:isExpanded:content:)](swiftui/disclosuregroup/init(_:isexpanded:content:).md)
- [init(isExpanded:content:label:)](swiftui/disclosuregroup/init(isexpanded:content:label:).md)

## Relationships

### Conforms To

- [View](swiftui/view.md)

## See Also

### Disclosing information progressively

- [OutlineGroup](swiftui/outlinegroup.md)
- [disclosureGroupStyle(_:)](swiftui/view/disclosuregroupstyle(_:).md)
