Disclosure Show/hide content with a toggle button.
Based on APG Disclosure Pattern .
Demo ▼ Show detailsThis is the disclosed content. It can contain any HTML elements including text, images, forms, or other components. The panel smoothly animates open and closed.
Usage let expanded = @ resource . signal ( false )
@ styled_disclosure . disclosure (
"details" ,
expanded,
"Show details" ,
[ @ luna . text ( "Hidden content goes here..." )],
)
Props Prop Type Default Description id String - Base ID for disclosure expanded Signal[Bool] - Expanded state trigger_text String - Button text children Array[Node] - Content to show/hide class String? None Additional CSS class
BEM Classes Class Description .disclosureRoot container .disclosure__triggerToggle button .disclosure__iconExpand/collapse icon .disclosure__panelContent panel .disclosure__contentInner content wrapper
States State Description data-state="open"Content visible data-state="closed"Content hidden
Keyboard Key Action Enter/Space Toggle visibility