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

ng-kzsidenav

v0.0.9

Published

An Angular Sidenav Component

Downloads

68

Readme

ng-kzsidenav

An Angular sidenav component

Installation

npm install --save ng-kzsidenav

Usage

Import KZSidenavModule into your App module:

...
import { KZSidenavModule } from 'ng-kzsidenav';

@NgModule({
    ...
    imports: [
      ...,
      KZSidenavModule
    ],
      ...
})
class AppModule {}

Add ng-kzsidenav.css into your angular.json

...
"styles": [
            "node_modules/ng-kzsidenav/ng-kzsidenav.css",
            ...
],
...

In your component's html, simply use <kzsidenav> wrapper and place your sidenav content within it. Your page content should be placed within a div having id kzmain. Inorder to use functions of sidenav like toggeling the open/close functionality add a reference to kzsidenav inside <kzsidenav>.

@Component({
  selector: 'app',
  template: `
        <style>
        /* CSS For Demo Purpose */
            .kzsidenav a {
                padding: 8px 8px 8px 32px;
                text-decoration: none;
                font-size: 25px;
                color: #818181;
                display: block;
                transition: 0.3s;
            }
            .kzsidenav a:hover {
                color: #f1f1f1;
            }
            .kzsidenav .closebtn {
                position: absolute;
                top: 0;
                right: 25px;
                font-size: 36px;
                margin-left: 50px;
            }
        </style>
        <kzsidenav #kzsidenav="kzsidenav">
        <!-- This code is for demo purpose. You can create your sidenav here after removing <a> tags -->
            <a href="javascript:void(0)" class="closebtn" (click)="kzsidenav.close()">&times;</a>
            <a href="#">About</a>
            <a href="#">Services</a>
            <a href="#">Clients</a>
            <a href="#">Contact</a>
        </kzsidenav>
        <div id="kzmain">
        <!-- This code is for demo purpose. You can put your main content here after removing the content inside <div id="kzmain">  -->
            <span (click)="kzsidenav.open()">open</span>
            <div style="text-align:center;">
                <h1> Welcome to App!</h1>
                <img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
            </div>
            <h2>Here are some links to help you start: </h2>
            <ul>
                <li>
                    <h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
                </li>
                <li>
                    <h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
                </li>
                <li>
                    <h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
                </li>
            </ul>
        </div>
  `
})

Functions

The kzsidenav has a few public functions:

| Function | Description | | -------- | ----------- | | open() | Opens the sidenav. | | close() | Closes the sidenav. | | toggle() | toggles the sidenav. | | currentState() | Returns the current state of sidenav. |

Options

Inputs

The kzsidenav has a few input properties:

| Property name | Type | Default | Description | | ------------- | ---- | ------- | ----------- | | mode | overlay, push, push-with-opacity, full | push | See the "Modes" section. | | position | left, right | left | What side the sidenav should be docked to. | | state | open,close | open | At what state the sidenav should be initialized when the page loads. | | openSize | number | 250px | Specify open width of sidenav with valid css dimension. | | closeSize | number | 0 | Specify close width of sidenav with valid css dimension. | | hoverAnimation | | | Whether to animate the sidenav on mouse enter and mouse leave when sidenav is closed. |

Modes

overlay

The side navigation slides in over the page content.

push

This is the default mode. The page content is pushed to make space for the side navigation.

push-with-opacity

The page content is pushed to make space for the side navigation with black background and opacity to highlight side navigation.

full

The side navigation slides and covers the whole page (100% width):