oggle the visibility of content across your project with a few classes and our JavaScript plugins.
Example
Click the buttons below to show and hide another element via class changes:
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
code
collapse-basic.html
<p> <button type="button" class="btn btn-outline-primary" (click)="collapse.toggle()" [attr.aria-expanded]="!isCollapsed" aria-controls="collapseExample" > Toggle with Function </button> <button type="button" class="btn btn-outline-primary ms-2" (click)="isCollapsed = ! isCollapsed" [attr.aria-expanded]="!isCollapsed" aria-controls="collapseExample" > Toggle with Two Way Binding </button> </p> <div #collapse="ngbCollapse" [(ngbCollapse)]="isCollapsed"> <div class="card"> <div class="card-body">You can collapse this card by clicking one Toggle button</div> </div> </div>
collapse-basic.ts
import { Component } from '@angular/core'; import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'ngbd-collapse-basic', standalone: true, imports: [NgbCollapseModule], templateUrl: './collapse-basic.html', }) export class NgbdCollapseBasic { public isCollapsed = false; }