preact-sidenav
v0.3.2
Published
A compact sidenav
Downloads
20
Readme
preact-sidenav
Minimal viable sidenav implementation.
Size:
| File | Size | Gzip | |------|------|----- | | js | 2,1K | 902B | | css | 2,3K | 626B |
Usage Example
Use and provide content and a navigation var
import Sidenav from 'preact-sidenav';
import '../node_modules/preact-sidenav/sidenav.css'
const Nav = () => (
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
)
const App = () => (
<Sidenav sidebar={ <Nav /> }
onClose={close} onOpen={open}>
<Content />
</Sidenav>
);
render(<App />, document.body);
Scss file is also provided