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

@cardboard-box/ngx-box

v0.0.9

Published

A collection of useful directives, components and services for angular

Downloads

32

Readme

@cardboard-box/ngx-box

A collection of useful directives, components and services for angular

Install

You can install this package via NPM (or your favourite npm compatible installer)

npm install @cardboard-box/ngx-box

Add the two modules into your project:

import { NgModule } from '@angular/core';
import { MagicCircleModule, NgxBoxModule } from '@cardboard-box/ngx-box';

@NgModule({
    declarations: [
        ...
    ],
    imports: [
        ...
        NgxBoxModule, //This is for all default components and directives
        MagicCircleModule //This is JUST for the magic-circle components
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule { }

Usage - Containers

There is a default container that handles things like loading circles, error states, and content states. This can be useful for handling different component states, scrolling components, and standardization of error messages.

You can use it like so:

<box-container
    [loading]="true"
    loading-text="This text is shown on the loading circle"
    error="Some error has occurred"
    handle-scroll
    >
    <!--Your component content-->
</box-container>
  • loading - Whether or not the component is in a loading state. (true / false)
  • loading-text - The text to show on the loading circle (string / undefined)
  • error - This is an error message to show if in an error state. If undefined, the component isn't in an error state (string / undefined)
  • handle-scroll - Whether or not to handle scrolling within the content, otherwise it hides any overflow.

You need to ensure that the parent element of the component has position of relative, absolute, or fixed.

Usage - Icons

A way of handling google material icons without needing to include the material libraries. You will need to include the material icons CDN into your index.html for them to showup. You can use this CDN reference:

<head>
    ...
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&amp;display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Kolker+Brush&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
</head>

You can use it like so:

<box-icon 
    font-size="24px" 
    [unsize]="false" 
    [fill]="false" 
    [spin]
    >
    warning
</box-icon>
  • font-size - The size of the font to use for the icon. (string / undefined)
  • unsize - Whether or not to remove explicit sizing and use the inherit option for most properties
  • fill - Whether or not to fill the icon in. This might not work for all icons. (boolean / undefined)
  • spin - Whether or not to have the icon spin. (boolean / undefined)