You can create a non-persistable enity GlobalVar and add a boolean attribute Expand with its defaults value as False.
On your page, put the detail deta in a container with conditional visibility based on the value of the attribute.
You can add a button with display style as hyperpink and show “”+” as its caption. On click action, this should call a microflow and change the value of this attribute to True, if it is False and set it to False, if it is True. That way it will work as Toggle
download the Javascript snippet widget and add it to your page, then call it on the action button invocation (class)
something similar to :
setTimeout(function(){
$('.toggleServ .btn').on('click', function() {
$(this).addClass('active').siblings().removeClass('active');
});
}, 1000);