Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng2-sidebar

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-sidebar

A sidebar component for Angular 2.

  • 0.3.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-88.71%
Maintainers
1
Weekly downloads
 
Created
Source

ng2-sidebar

NPM

Demo

An Angular 2 sidebar component.

Installation

npm install --save ng2-sidebar

Usage

Import the component and add it to the list of directives on your component:

import { Sidebar } from 'ng2-sidebar';

@Component({
  selector: 'example',
  directives: [Sidebar],
  template: `
    <ng2-sidebar [(open)]="_open">
      <p>Sidebar contents</p>
    </ng2-sidebar>

    <button (click)="_toggleSidebar()">Toggle sidebar</button>
  `
})
export class MyComponent {
  private _open: boolean = false;

  private _toggleSidebar() {
    this._open = !this._open;
  }
}

Options

[(open)]="boolean_value"

Boolean input value that controls the visibility of the sidebar. This should be two-way bound in case the value changes when the sidebar is closed by clicking outside of it when closeOnClickOutside is enabled.

Default: false.

[pullRight]="boolean_value"

Boolean input value that controls if the sidebar should appear on the right side of the viewport.

Default: false.

[closeOnClickOutside]="boolean_value"

Boolean input value that controls whether clicking outside of the open sidebar will close it.

Default: false.

[showOverlay]="boolean_value"

Boolean input value that controls if a translucent black overlay should appear over the page contents when the sidebar is open.

Default: false.

[defaultStyles]="boolean_value"

Applies some default styles to the sidebar.

Default: false.

[sidebarClass]="'string_value'"

A string used as an additional class name on the sidebar element.

[overlayClass]="'string_value'"

A string used as an additional class name on the overlay element.

[ariaLabel]="'string_value'"

A string used as the aria-label attribute on the sidebar.

(onOpen)="func_call()"

An output event, emitted when the sidebar is opened.

(onClose)="func_call()"

An output event, emitted when the sidebar is closed.

Keywords

FAQs

Package last updated on 24 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc