Open History to see the last commit
1import * as React from 'react';
2import cn from 'classnames';
3export const Sticky = ({
4 offset,
5 children,
6 shadow
7}) => {
8 return <div style={{
9 top: offset || 0
10 }} className={cn({
11 shadow
12 }, 'z-10')}>
13 {children}
14β
15 <style jsx>{`
16 div {
17 background: #fff;
18 position: sticky;
19 }
20 div.shadow {
21 box-shadow: rgba(0, 0, 0, 0.06) 0px 6px 20px;
22 }
23 `}</style>
24 </div>;
25};
26Sticky.displayName = 'Sticky';