Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jordic/preact-sidenav

preact sidenav component
https://github.com/jordic/preact-sidenav

layout material preact sidenav

Last synced: 2 months ago
JSON representation

preact sidenav component

Awesome Lists containing this project

README

        

# preact-sidenav

Minimal viable sidenav implementation.

> **[Demo](https://jsfiddle.net/jordic/sqj852y4/)**

Size:

| File | Size | Gzip |
|------|------|----- |
| js | 2,1K | 902B |
| css | 2,3K | 626B |

### Usage Example

Use and provide content and a navigation var

```js
import Sidenav from 'preact-sidenav';

import 'node_modules/preact-sidenav/dist/sidenav.css';

const Nav = (props) => (



  • Menu item 1

  • Menu item 2

  • Menu item 3

  • Close


)

class App extends Component {

onOpen = () => console.log('open');
onClose = () => console.log('close');

render(props, state) {
return (


} onOpen={this.onOpen} onClose={this.onClose}>



);
}
}

render(, document.body);
```

Scss file is also provided

### License

[MIT]

[MIT]: http://choosealicense.com/licenses/mit/