pub fn section_expanded(
is_expanded: &BoundState<bool>,
header: View,
content: View,
) -> ViewExpand description
Section(isExpanded:) { … } header: { … } — a section that collapses.
The disclosure state is bound to Rust state rather than given as an initial value, so the section opens and closes by itself and whatever else reads that state sees it.
let open = BoundState::new(true);
let s = section_expanded(&open, text("Advanced"), text("the details"));