Sticky positions its target component as fixed, so that the component stays in the viewport of the window during scrolling. Scroll down to see the sticky toolbar. stickyTopAt names the fixed topbar of the showcase, so that its height is considered when the toolbar is positioned.
<div class="card">
<p:toolbar id="tb">
<f:facet name="left">
<p:commandButton type="button" value="New" icon="pi pi-file" styleClass="mr-2" />
<p:commandButton type="button" value="Open" icon="pi pi-folder-open" styleClass="p-button-success" />
</f:facet>
<f:facet name="right">
<p:commandButton type="button" title="Save" icon="pi pi-save" styleClass="warn-button mr-2" />
<p:commandButton type="button" title="Delete" icon="pi pi-trash" styleClass="p-button-danger mr-2" />
<p:commandButton type="button" title="Print" icon="pi pi-print" styleClass="p-button-help" />
</f:facet>
</p:toolbar>
<div style="height:800px"></div>
<p:sticky target="tb" stickyTopAt=".layout-topbar"/>
</div>