Just paste this code for sticky header in tailwind css
xxxxxxxxxx
<div>
<header class="sticky top-0 z-50"></header>
<main class=relative></main>
<footer></footer>
</div>
xxxxxxxxxx
If your element isn't sticking as expected the first thing to check are the rules applied to the container.
Specifically, look for any overflow property set on any parents of the element. You can't use: overflow: hidden, overflow: scroll or overflow: auto on the parent of a position: sticky element.