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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@craftsjs/menu-admin

v6.1.1

Published

Material menu library for angular

Readme

craftsjs menu

CraftsJS menu is a library for Angular.

See demo

Example code

Getting Started

To get started, let's install the package through npm:

Choose the version corresponding to your Angular version:

| Angular | @craftsjs/menu-admin | | ------- | -------------------- | | 18 | 6.x | | 15 | 5.x | | 13 | 4.x | | 12 | 3.x | | 11 | 2.x |

npm i @craftsjs/menu-admin --S

Install peer dependencies

npm i @craftsjs/responsive @craftsjs/ngrx-action @craftsjs/perfect-scrollbar @craftsjs/core perfect-scrollbar @ngrx/store @ngx-translate/core --S

Configuration

The library is configured as follows:

import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';

export function createTranslateLoader(http: HttpClient) {
    return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
@NgModule({
    imports: [
        HttpClientModule,
        TranslateModule.forRoot({
            loader: {
                provide: TranslateLoader,
                useFactory: (createTranslateLoader),
                deps: [HttpClient]
            }
        })
    ]
})
export class AppModule { }
import { ResponsiveModule } from '@craftsjs/responsive';
@NgModule({
    imports: [
        StoreModule.forRoot(...your configuration),
        EffectsModule.forRoot([]),
        ResponsiveModule // important
    ],
})
export class AppModule { }

How to use (standalone, Angular 15+/18)

  • Providers en el bootstrap (registra el feature del menú):
// main.ts
import { bootstrapApplication, importProvidersFrom } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideStore } from '@ngrx/store';
import { provideCraftsjsMenu } from '@craftsjs/menu-admin';
import { AppComponent } from './app/app.component';
import { TranslateModule } from '@ngx-translate/core';

bootstrapApplication(AppComponent, {
    providers: [
        provideAnimations(), // or provideNoopAnimations()
        provideStore(),
    provideCraftsjsMenu(),
        // i18n (opcional, según tu app)
        importProvidersFrom(TranslateModule.forRoot())
    ]
});
  • Usa los componentes standalone del menú en tu componente:
// app.component.ts
import { Component } from '@angular/core';
import { MenuComponent, MenuHeaderComponent, MenuUserComponent, MenuItemsLinkComponent } from '@craftsjs/menu-admin';

@Component({
    selector: 'app-root',
    standalone: true,
    imports: [MenuComponent, MenuHeaderComponent, MenuUserComponent, MenuItemsLinkComponent],
    templateUrl: './app.component.html'
})
export class AppComponent {}
// component (ejemplo de datos)
import { MenuModel, MenuHeaderModel, MenuUserModel } from '@craftsjs/menu-admin';
@Component({
    // ...
})
export class ExampleComponent {
    // variable to show the links of the menu
    menus: MenuModel[] = [
    {
        id: '1',
        class: 'material-icons',
        value: 'dashboard',
        title: 'menu.dashboard',
        isOpen: false,
        multiOption: false,
        url: '/admin/dashboard',
        exact: true,
    },
    {
        id: '2',
        class: 'material-icons',
        value: 'chrome_reader_mode',
        title: 'menu.forms',
        isOpen: false,
        multiOption: true,
        exact: true,
        children: [
            {
                id: '3',
                value: 'BF',
                title: 'menu.form.basicForm',
                isOpen: false,
                multiOption: false,
                url: '/admin/forms/basic-form',
                exact: true
            }
        ]
    }]

    // header of the menu
    header: MenuHeaderModel = {
        companyName: 'craftsjs',
        logoUrl: 'assets/images/logo/addaptables.svg'
    };

    // user data
    user: MenuUserModel = {
        initialName: 'Cf',
        fullName: 'Craftsjs',
        email: '[email protected]',
        avatarUrl: 'assets/images/avatars/Velazquez.jpg'
    };
}
<craftsjs-menu>
    <menu-header [header]="header"></menu-header>
    <menu-user [user]="user"></menu-user>
    <menu-items-link [menus]="menus"></menu-items-link>
</craftsjs-menu>
<button-mobile></button-mobile>

Lazy por rutas (opcional)

// app.routes.ts
import { Routes } from '@angular/router';
import { provideCraftsjsMenu } from '@craftsjs/menu-admin';

export const routes: Routes = [
    {
        path: 'admin',
        loadComponent: () => import('./admin/admin.component').then(m => m.AdminComponent),
    providers: [provideCraftsjsMenu()]
    }
];

NgModule (compatibilidad)

import { MenuModule } from '@craftsjs/menu-admin';
@NgModule({
    imports: [MenuModule]
})
export class YourModule {}
@import '~@craftsjs/core/craftsjs-grid.theme';
@import '~@angular/material/theming';
@import '~@craftsjs/menu-admin/_craftsjs-menu.theme.scss';

$app-primary: mat-palette($mat-teal, 800);
$craftsjs-app-accent:  mat-palette($mat-pink, 800, A100, 100);
$craftsjs-app-warn: mat-palette($mat-red);
$craftsjs-app-theme: mat-light-theme($craftsjs-app-primary, $craftsjs-app-accent, $craftsjs-app-warn);
$craftsjs-theme-variables: (
    text: white,
    transition-time: 250ms,
    border-radius: 5px
);
@include mat-core();
body.theme-default {
    @include angular-material-theme($craftsjs-app-theme);
    @include menu($craftsjs-app-theme, $craftsjs-theme-variables);
}
<body class="theme-default"></body>

Notas

  • Requiere @ngrx/store provisto en la app (p. ej., provideStore() en standalone o StoreModule.forRoot() en NgModule).
  • Angular Material necesita provideAnimations() o NoopAnimations.
  • Evita registrar el mismo feature key más de una vez.

Assets

Background menu sidebar

/assets/images/backgrounds/sidebar.jpg

Compatibility

Current version: 6.1.0 (Compatible with Angular v18)