StickyBox
Sticky box. Based on react-sticky-box.
Props
bottom = {boolean | default: false}- If
true, content will stick to the bottom of viewport, note that you also need to make sure that the css is set up correctly. The container should use e.gdisplay: flex; align-items: flex-end;.
- If
offsetTop = {number | default: 0}- Defines the offset to the top of the viewport in pixels.
offsetBottom = {number | default: 0}- Defines the offset to the bottom of the viewport in pixels.
Example with code
import StickyBox from '@components/StickyBox ';
const MyComponent = () => {
return (
<StickyBox offsetTop={20} offsetBottom={20} />
);
};