I\'m using Collapse: https://ng-bootstrap.github.io/#/components/collapse
However, it does not animate; even not on the demo site. How should I implement this??
Because they use "display: none" to hide and "display: block" to show element, you can't apply "transition" CSS property.
So, force display block, manage height & opacity to toggle hide/show :
.collapse, .collapse.in {
display: block !important;
transition: all .25s ease-in-out;
}
.collapse {
opacity: 0;
height: 0;
}
.collapse.in {
opacity: 1;
height: 100%;
}
With basic transition and opacity/height, it seem to be more smooth.
You can make your own animation with keyframe and apply to .collapse.in to get better toggle hide/show experience.
And then, if you use Angular 2 in your project, you can switch to ng2-bootstrap : http://valor-software.com/ng2-bootstrap/