added ability to pass collapse callback from library consumer template