Card collapse without using accordion

MDB SupportCategory: MDB jQueryCard collapse without using accordion
lede Pro UserPremium asked 1 week ago in MDB pro, version:4.5.6

I think this should be added to the collapse page so we can have cards collapsing without an accordion

<div class="card">
  <div class="card-header">
    <a data-toggle="collapse" href="#collapseContent46" class="collapsed" aria-expanded="false" aria-controls="collapseContent46">
      <h5 class="mb-0">Content <i class="fa fa-angle-down rotate-icon float-right"></i></h5>
    </a>
  </div>
  <div id="collapseContent46" class="card-body collapse"> 
  </div>
</div>

<div class="card">
  <div class="card-header">
    <a data-toggle="collapse" href="#collapseContent47" aria-expanded="true" aria-controls="collapseContent47">
      <h5 class="mb-0">Content <i class="fa fa-angle-down rotate-icon"></i></h5>
    </a>
  </div>
  <div id="collapseContent46" class="card-body collapse show"> 
  </div>
</div>

Then I just added the couple of .accordion .card styles to just .card to make the rotate-icon float right and rotate on expand/collapse.

.card .rotate-icon {
  float: right;
}

.card a:not(.collapsed) .rotate-icon {
  -webkit-transform: rotate(180deg);
  -ms-transform: rotate(180deg);
  transform: rotate(180deg);
}

This allows the cards to collapse independently with the same effect that you have on the accordion collapsing

Bartłomiej Malanowski Pro User replied 6 days ago

So much thank you for the tip! I’ve added your solution to our TODO list