Sticky
A floating box that stays put within a section while scrolling
import Sticky from "@intility/bifrost-react/Sticky";Basic usage
This is basically the same as position: sticky; on any other element, except
we also:
- Account for
<Nav>top bar height - Synchronize animation with top bar when it hides/appears on scroll for mobile screens
- Supply a scrollbar inside when content height exceeds viewport height
Custom top position
--bf-page-padding is the default top position (below Nav top
bar, if any), but can be configured through top.
The value can be any css length string or a number (in px).
Remove styling
By default, the Sticky box gets styled with:
Remove them with the unstyled prop.
Multiple sections
Content below the <Sticky> will push it upwards, which allows you to have
multiple sections with their own sticky header as well as a sticky side-box.
You can also set a custom top value, here at 80 to match the section header.