https://css-tricks.com/using-css-transitions-auto-dimensions/
<html>
<style>
#target {
overflow: hidden;
/* animate css support */
transition: all linear .2s;
}
</style>
<body>
<div id="target">
<!-- dynamic count element in this -->
</div>
</body>
</html> import { getCollapseAndExpandContainerFn } from 'height-transitioner';
const { collapseContainer, expandContainer } = getCollapseAndExpandContainerFn(document.getElementById('target))
// now call collapse or expand funciton based on your needs