1.0.0 • Published 6 years ago

ngx-flyout v1.0.0

Weekly downloads
214
License
MIT
Repository
github
Last release
6 years ago

demo

NPM

No Drama Sidebar/Flyout/Sidenav Component For Angular 6 and greater.

Installation

npm i ngx-flyout --save

Changelog

See the releases page on GitHub.

Usage

Add FlyoutModule to your app module:

import { FlyoutModule } from 'ngx-flyout';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, FlyoutModule],
  bootstrap: [AppComponent],
})
class AppModule {}

In your app component, simply use add a <ngx-flyout> wrapper, then place the content you want in your flyout within it.

@Component({
  selector: 'app',
  template: `
    <!-- Container for sidebar(s) + page content -->
    <ngx-flyout [(open)]="openFlyout">
        <ul>
            <li>Menu 1</li>
            <li>Menu 2</li>
            <li>Menu 3</li>
        </ul>
    </ngx-flyout>

    <button (click)="toggleSidebar">
        Toggle Flyout
    </button>
  `
})
class AppComponent {
  private openFlyout: boolean = false;

  private toggleSidebar() {
    this.openFlyout = !this.openFlyout;
  }
}

Options

Inputs

Property nameTypeDefaultDescription
openbooleanfalseControls the open state of the flyout. This should be two-way bound.
position'left', 'right', 'top', 'bottom''right'What side the flyout should open.
showCloseButtonshowCloseButton: booleantrueControls visibility of close button.
flyoutClassesflyoutClasses: string[]Additional styling classes for flyout.
showBackdropshowBackdrop: booleantrueControls visiblity of backdrop.
hideOnBackdropClickhideOnBackdropClick: booleantrueIf clicking on backdrop closes the flyout or not.
backdropClassesbackdropClasses: string[]Additional styling classes for backdrop

Outputs

Property nameCallback argumentsDescription
flyoutOpenedEmitted when flyout is opened.
flyoutClosedEmitted when flyout is closed.
openChangeopen: booleanEmitted when open is modified. This allows to do "two-way binding"
1.0.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago