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

@cyazyx/cx-mat-layout

v1.3.3

Published

Material layout common implementation scenarios and helpers. Easily setup a sidebar and top navigation with ZERO hustle.

Downloads

213

Readme

CX Mat Layout

This library provides common layout setup for material menus and content setup. This is a collection of menus (top, sidebar), content area and positioning layouts, etc. With this library, you don't need any template or external dependency as it only depends on @angular/material.

Supported Versions

The following are the versions as supported by different @angular/core and @angular/material packages;

| Package Version | Angular Core Version | | --------------- | -------------------- | | 0.919.5 | 9.1.9 | | 0.9111.1 | 9.1.11 | | 1.0.0 | 10.0.0 | | 1.1.0 | 10.0.5 | | 1.1.2 | 10.1.0 | | 1.2.0 | 11.0.2 | | 1.3.2 | 12.0.2 |

Getting Started

You need @angular project to start. Once you setup your Angular project, you can then follow the following steps:

  1. Install cx-mat-layout:

    npm i -s @cyazyx/cx-mat-layout
  2. In the module that you plan to use the layout module, import it, for instance, if you are using AppModule as your layout root;

        import { CxMatLayoutModule } from '@cyazyx/cx-mat-layout';
  3. In your module imports, include the CxMatLayoutModule;

        imports: [
            CommonModule,
            CxMatLayoutModule,
            // ...Other imports
        ]
  4. In your styles.scss, import our theming file:

        @import '~@cyazyx/cx-mat-layout/styles/cx-mat-layout.style.scss';

    This file is open source and you can customize the styles as you deem fit.

  5. In your component.ts file, import:

        import { NavigationItem } from '@cyazyx/cx-mat-layout';

    This is used to build navigation menu items. See sample code at GitHub for example navigation items.

  6. Build your menu items, e.g.

        // Define a property for holding menus items
        menus: NavigationItem[];
    
        // Your ngOnInit lifecycle hook to load the paths
        ngOnInit(): void {
            this.menus = [
                { title: 'Home', url: '/dashboard' },
                {
                    title: 'Services', children: [
                        { title: 'Buying' },
                        { title: 'Selling' },
                    ]
                }
            ];
        }
  7. Update your layout component HTML to include cx-mat-layout definitions;

        <cx-mat-layout [navigationItems]="menus">
            <!--Top Menu-->
            <cx-mat-menu-top>
                <div class="menu-part">
                    <a mat-button [routerLink]="'/'" [routerLinkActive]="'active'">
                        <mat-icon>home</mat-icon>
                        <span>Homepage</span>
                    </a>
                    <button mat-button>About Us</button>
                    <button mat-button>Contact Us</button>
                </div>
            </cx-mat-menu-top>
            <!--Every other content is loaded as router-outlet-->
            <router-outlet></router-outlet>
        </cx-mat-layout>
  8. You are all set, you can now focus on building your application, with native material layout instead of focusing on layout issues.

Usage

The following are the concepts associated with this package definition:

Components

There are a number of components that make up the package;

  1. CxMatLayoutComponent (selector: cx-mat-layout) - This is the container for layout items. It allows for the following inputs:

    1. navigationItems - For the list of navigation items.
    2. topnavColor - The color attribute of the top navigation bar. Based on angular theming as applied to mat-toolbar. Defaults to primary.
    3. topProgressBarColor - The progress bar color at the top. Defaults to warn.
    4. sidenavToggleTitle - The title string to display on hover of the sidenav toggle.
    5. topnavPosition - The position of the top toolbar. Either fixed or relative. Defaults to fixed.
    6. showTopNav - Whether to display the top navigation toolbar.
  2. CxMatMenuComponent (selector: cx-mat-menu) - This is the menu componnent that loops through the menu items and renders them. If you have to write your own custom menu item layout, you can use this to display your menu items directly. The following inputs are supported:

    1. navigationItems - For the list of navigation items.
    2. fullWidth - Whether we are displaying side by side or whether the menu will be a popover.

    Directly using this requires you to write your own layout logic and styling. You can use the existing source code as a starting point.

  3. CxMatMenuItemComponent (selector: cx-mat-menu-item) - This is the menu item renderer that recursivey loops through the menu items and renders them. This component supports the following inputs:

    1. navigationItem - The single navigation item to be displayed.
    2. selectedItems - The list of items that have been selected. This menu item is selected if it's found within the selectedItems array.
    3. level - The menu item level in the tree.
    4. fullWidth - Whether we are displaying side by side or whether the menu will be a popover.
    5. isParentExpanded - Whether the parent node is selected or not.
  4. CxMatMenuTopComponent (selector: cx-mat-menu-top) - The content holder for top menu toolbar.

Services

The following are the services defined for the package.

  1. CxMatLayoutService - The layout service used for various functionality.

Theming

You can theme the layout using the default/ original material theming implementation. The theme implementation has been left to you and by default, everything can be adjusted.

Contributing

Raise your issues and pull requests on GitHub

What to Contribute

We have different parts you can contribute to. These include:

  1. Package functionality
  2. Tooling improvements
  3. Tests and coverage improvements
  4. Documentation
  5. Customization

Ask to Contribute

You can also request repository read access at mail with the parts you can contribute to and we shall get back to you with more information.