Collapsible
One section whose content shows and hides when its trigger is tapped.
Installation
Usage
src/app/app.ts
[(open)]keeps your signal and the collapsible in step. Leave it out if you don't need the state.- The trigger is a row (
flex-row items-center) and doesn't wrap its content, so put your own<text>elements inside. - Content shows only while open. It slides and fades in as it opens.
Open from code
Set the bound signal, for example this.open.set(true), and the content opens. UiCollapsible also has a public toggle() method, which does nothing while disabled.
Disabled
The trigger dims and ignores taps. Setting open from code still works.
API
UiCollapsible
All sub-components (UiCollapsibleTrigger, UiCollapsibleContent) accept class.
Related
- Accordion: several sections that open one at a time
- Signals and change detection
