npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@material-git/sidenav

v2.0.0-git.20160919

Published

Angular 2 Material sidenav

Downloads

17

Readme

MdSidenav

MdSidenav is the side navigation component for Material 2. It is composed of two components; <md-sidenav-layout> and <md-sidenav>.

Screenshots

<md-sidenav-layout>

The parent component. Contains the code necessary to coordinate one or two sidenav and the backdrop.

Properties

| Name | Description | | --- | --- | | start | The start aligned MdSidenav instance, or null if none is specified. In LTR direction, this is the sidenav shown on the left side. In RTL direction, it will show on the right. There can only be one sidenav on either side. | | end | The end aligned MdSidenav instance, or null if none is specified. This is the sidenav opposing the start sidenav. There can only be one sidenav on either side. |

<md-sidenav>

The sidenav panel.

Bound Properties

| Name | Type | Description | | --- | --- | --- | | align | "start"|"end" | The alignment of this sidenav. In LTR direction, "start" will be shown on the left, "end" on the right. In RTL, it is reversed. "start" is used by default. An exception will be thrown if there are more than 1 sidenav on either side. | | mode | "over"|"push"|"side" | The mode or styling of the sidenav, default being "over". With "over" the sidenav will appear above the content, and a backdrop will be shown. With "push" the sidenav will push the content of the <md-sidenav-layout> to the side, and show a backdrop over it. "side" will resize the content and keep the sidenav opened. Clicking the backdrop will close sidenavs that do not have mode="side". | | opened | boolean | Whether or not the sidenav is opened. Use this binding to open/close the sidenav. |

Events

| Name | Description | | --- | --- | | open-start | Emitted when the sidenav is starting opening. This should only be used to coordinate animations. | | close-start | Emitted when the sidenav is starting closing. This should only be used to coordinate animations. | | open | Emitted when the sidenav is done opening. Use this for, e.g., setting focus on controls or updating state. | | close | Emitted when the sidenav is done closing. |

Methods

| Signature | Description | | --- | --- | | open(): Promise<void> | Open the sidenav. Equivalent to opened = true. Returns a promise that will resolve when the animation completes, or be rejected if the animation was cancelled. | | close(): Promise<void> | Close the sidenav. Equivalent to opened = false. Returns a promise that will resolve when the animation completes, or be rejected if the animation was cancelled. | | toggle(): Promise<void> | Toggle the sidenav. This is equivalent to opened = !opened. Returns a promise that will resolve when the animation completes, or be rejected if the animation was cancelled. |

Notes

The <md-sidenav> will resize based on its content. You can also set its width in CSS, like so:

md-sidenav {
  width: 200px;
}

Try to avoid percent based width as resize events are not (yet) supported.

Examples

Here's a simple example of using the sidenav:

<app>
  <md-sidenav-layout>
    <md-sidenav #start (open)="mybutton.focus()">
      Start Sidenav.
      <br>
      <button md-button #mybutton (click)="start.close()">Close</button>
    </md-sidenav>
    <md-sidenav #end align="end">
      End Sidenav.
      <button md-button (click)="end.close()">Close</button>
    </md-sidenav>

    My regular content. This will be moved into the proper DOM at runtime.
  </md-sidenav-layout>
</app>