# ngx-yazuo-sidenav

> A simple sidenav with dinamic content

Latest version **1.3.6** (published 2020-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-yazuo-sidenav
pnpm add ngx-yazuo-sidenav
yarn add ngx-yazuo-sidenav
bun add ngx-yazuo-sidenav
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.6 |
| Published | 2020-11-09 |
| First published | 2020-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 77 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maicon Funke |
| Maintainers | maicon.funke |
| Keywords | side dialog, sidenav, angular, components, side content |

## Links

- npm: https://www.npmjs.com/package/ngx-yazuo-sidenav
- Repository: https://github.com/maiconfunke/ngx-yazuo/tree/master/projects/ngx-yazuo-sidenav
- Homepage: https://github.com/maiconfunke/ngx-yazuo/tree/master/projects/ngx-yazuo-sidenav#readme
- Issues: https://github.com/maiconfunke/ngx-yazuo/issues
- npm.io page: https://npm.io/package/ngx-yazuo-sidenav

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0
- [ngx-yazuo-click-outside](https://npm.io/package/ngx-yazuo-click-outside.md) ^1.0.1

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [post-robot](https://npm.io/package/post-robot.md) — 93.7K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads

## Recent versions

- 1.3.6 (latest) — 2020-11-09
- 1.3.5 — 2020-11-09
- 1.3.4 — 2020-11-09
- 1.3.3 — 2020-11-09
- 1.2.3 — 2020-10-21
- 1.2.2 — 2020-10-21
- 1.2.1 — 2020-10-16
- 1.2.0 — 2020-10-16
- 1.1.3 — 2020-10-13
- 1.1.2 — 2020-10-12
- 1.1.1 — 2020-10-12
- 1.1.0 — 2020-10-12
- 1.0.2 — 2020-10-08
- 1.0.1 — 2020-10-08
- 1.0.0 — 2020-10-08
- … 1 more at https://npm.io/package/ngx-yazuo-sidenav/versions

## README

## NgxYazuoSidenav

## Installation

`npm install --save ngx-yazuo-sidenav`

## Usage

### Module:

Import `gxYazuoSidenavModule` from `ngx-yazuo-sidenav`

```javascript
import { NgxYazuoSidenavModule } from 'ngx-yazuo-sidenav';

@NgModule({
  imports: [ NgxYazuoSidenavModule.forRoot() ]
})
```

### Component

1. Markup

```html
<button (click)="showSideNav()">Show Sidenav</button>

<ng-template #content>
   <h1>HELLO WORD!</h1>
</ng-template>
```

2. Component method

```javascript
import { Component, TemplateRef, ViewChild } from '@angular/core';
import { YazuoSidenavSettings, NgxYazuoSidenavService, YazuoSidenavDirection } from 'ngx-yazuo-sidenav';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'app';

  @ViewChild('content', {static: true}) content: TemplateRef<any>;

  constructor(private yazuoSidenav: NgxYazuoSidenavService) {}

  settings: YazuoSidenavSettings = {
    bgColor:'#eeeeee', //default: '#eeeeee'
    width: 100, //default: 75
    animationTime: 1, //default: 0.5s
    position: YazuoSidenavDirection.Right, //default: YazuoSidenavDirection.Left
    bgBackDrop: 'rgba(0,0,0,0.2)', //default: rgba(0,0,0,0.2)
    backdrop: false, //default: true,
    clickOutside: false //default: true
    btnClose: false //default: true
  };

  showSideNav(): void {
    this.yazuoSidenav.open(this.content, this.settings); //settings is optional
  }

  closeSideNav(): void {
    this.yazuoSidenav.close()
  }
}
```

## YazuoSidenav options
```javascript
export interface YazuoSidenavSettings {
  bgColor?: string; //color background sidenav
  animationTime?: number; //duration for animation on close
  width?: number; //width of sidenav component
  position?: YazuoSidenavDirection; //position start sidenav: left ou right
  backdrop?: boolean; //show backdrop
  bgBackDrop?: string; //color for backdrop
  clickOutside?: boolean; //close the sidenav when clicked outside
  btnClose?: boolean; //flag for hidden or show close button
}
```

---
_Source: https://npm.io/package/ngx-yazuo-sidenav · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
