node package manager

preact-sidenav

preact-sidenav

Minimal viable sidenav implementation.

Demo

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

License

MIT