This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
DisclosureGroup
用于显示可展开内容的 SwiftUI DisclosureGroup 组件。
iOS
Included in Expo Go
Expo UI DisclosureGroup 与官方 SwiftUI DisclosureGroup API 相对应,并显示一个可展开或收起内容的披露指示符。


安装
Terminal
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
基本披露组
DisclosureGroup 最常用于 Form 内,以应用标准的 iOS 列表样式和箭头指示符。
BasicDisclosureGroupExample.tsx
初始展开
将 isExpanded 初始设为 true,即可默认显示内容。
InitiallyExpandedExample.tsx
自定义标签
如果标签需要自定义 SwiftUI 内容或修饰符,而不是使用 label 字符串属性,请使用 DisclosureGroup.Label。
CustomLabelDisclosureGroupExample.tsx
API
import { DisclosureGroup } from '@expo/ui/swift-ui';
Component
Type: React.Element<DisclosureGroupProps>
Type:
ReactNodeOptional • Type:
stringText label for the disclosure group. Use DisclosureGroup.Label for custom label content.
Optional • Type:
(isExpanded: boolean) => voidA callback that is called when the expansion state changes.