How to make a fixed header when scrolling?

The header component needs to be turned into a top-level container, with z-index: 1; and position: fixed; or position: sticky;

In this way it will remain sticky at the top when you are scrolling.

Was this article helpful?
Cancel
Thank you!