<!--
{
  "availability" : [
    "macOS: 10.15.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Section/collapsible(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI7SectionVA2A4ViewRzAaDR_AaDR0_rlE11collapsibleyQrSbF"
  },
  "title" : "collapsible(_:)"
}
-->

# collapsible(_:)

Sets whether a section can be collapsed by the user.

```
func collapsible(_ collapsible: Bool) -> some View
```

## Discussion

This modifier only applies to sections in [`List`](/documentation/SwiftUI/List) views that have the
[`sidebar`](/documentation/SwiftUI/ListStyle/sidebar) style.

---

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)