How to create a fixed header

Hello! i just have a question. I want a sticky header but i also want it to collapse height when hidden. Is it possible to make a floating group collapse or is it possible to make a header sticky inside a normal group.