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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ngx-menu-toggler

v20.0.2

Published

An Angular component for toggling menus in a simple and customizable way

Readme

NgxMenuToggler - Angular Menu Toggler

ngx-menu-toggler is an standalone, reusable and customizable component for Angular 18, 19 and 20.

It is designed to work with signals and Angular zoneless, providing a lightweight, flexible, and accessible menu toggler.

Installation

If you want to install the latest version (currently 20):

npm install ngx-menu-toggler

Angular 19:

npm install ngx-menu-toggler@angular19

Angular 18:

npm install ngx-menu-toggler@angular18

Basic Usage

Using ngx-menu-toggler is very simple. Only two inputs/outputs are required: [isOpen] and (setIsOpen). All other assignable attributes are explained below and are for you to customize to your liking.

| Prop | Description | Type | Default | | ------------ | ------------------------ | -------------------------- | ------- | | isOpen | Current isOpen value | boolean | false | | setIsOpen | Toggle the isOpen value | (value: boolean) => void | X |

Here is a simple example of use:

import { Component, signal } from '@angular/core';
import { NgxMenuToggler } from 'ngx-menu-toggler';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [NgxMenuToggler],
  template: `
    <ngx-menu-toggler
      [isOpen]="menuOpen()"
      (setIsOpen)="menuOpen.set($event)"
    />
  `
})
export class App {
  menuOpen = signal<boolean>(false);
}`

Advanced Usage / Optional Attributes

In addition to [isOpen] and (setIsOpen), ngx-menu-toggler provides several optional attributes to customize its appearance and behavior.

<ngx-menu-toggler
  [isOpen]="menuOpen()"
  (setIsOpen)="menuOpen.set($event)"
  type="uneven"
  invert="true"
  [thin]="true"
  [rounded]="true"
  color="#FF5733"
  animation="rotateY"
  [faster]="true"
  [tabIndex]="1"
  ariaLabelOpened="Close menu"
  ariaLabelClosed="Open menu"
/>

Style Options

| Input | Description | Type | Default | | ----------- | --------------------------------------------------- | ------- | --------- | | type | Toggler design: 'bars', 'dots', 'uneven' | string | 'bars' | | invert | Mirror effect when type="uneven" | boolean | false | | thin | It makes lines or dots thinner | boolean | false | | [rounded] | Rounded borders | boolean | false | | color | Toggler color | string | 'black' | | animation | Animation style: 'rotateX', 'rotateY', 'soft' | string | 'soft' | | [faster] | Speeds up the rotate animation | boolean | false |

Accessibility Options

| Input | Description | Type | Default | | ----------------- | ---------------------------------------- | ------ | -------------- | | [tabIndex] | Controls the button tabindex attribute | number | 0 | | ariaLabelOpened | Custom aria-label when menu is opened | string | 'Close menu' | | ariaLabelClosed | Custom aria-label when menu is closed | string | 'Open menu' |

The component is already optimized for accessibility by default.

Advance custom styles

Custom size

This component comes with an initial size of 40px. You can easily change its size by setting the --menu-toggler-size CSS variable. For example:

ngx-menu-toggler{
    --menu-toggler-size: 40px;
}

Custom styles

You can customize styles by using ::gn-deep in css. For example:

:ng-deep .ngxMenuToggler__button{
  background color: red
}

Customizable elements

  • .ngxMenuToggler__button → The main button element
  • .ngxMenuToggler__bar → Individual bars inside the button
  • .ngxMenuToggler__bar--1 → Top bar
  • .ngxMenuToggler__bar--2 → Hidden bar for spacing
  • .ngxMenuToggler__bar--3 → Bottom bar
  • .ngxMenuToggler__bar--4 → Cross bar (positioned absolutely)
  • .ngxMenuToggler__bar--5 → Cross bar (positioned absolutely)

You can target different states by combining classes. For example:

:ng-deep .ngxMenuToggler__button.isOpen {
  background-color: red;
}

:ng-deep .ngxMenuToggler__bar--1 {
  background-color: blue;
}

:ng-deep .ngxMenuToggler__bar.rounded {
  border: 2px solid red;
}

:ng-deep .ngxMenuToggler__bar.dots {
  filter: drop-shadow(0 0 0.75rem red);
}

📌 Report or suggest something

Choose the form that best fits your case:

👉 Or go to the form selector.

License

MIT