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

vk-library

v1.0.1

Published

Reusable Angular components: Bootstrap alert, paginated data table with filters/actions, and loading spinner. All configurable via JSON.

Downloads

33

Readme

vk-library

Reusable Angular 21+ standalone components, all configurable via JSON config objects:

  • <vk-alert> — Bootstrap alerts with auto-dismiss, icons, custom styles
  • <vk-data-table> — Paginated table with sortable columns, filters, row/cell CSS, and action buttons with icons
  • <vk-loading> — Loading spinner/dots/bar/ring with optional full-screen overlay

Requires Bootstrap 5 CSS and Font Awesome loaded in your project.


Installation

npm install vk-library @fortawesome/fontawesome-free

Add Bootstrap 5 and Font Awesome to your angular.json or import in styles.scss:

@import "bootstrap/dist/css/bootstrap.min.css";
@import "@fortawesome/fontawesome-free/css/all.min.css";

vk-alert

Config: VkAlertConfig

| Property | Type | Default | Description | |---|---|---|---| | type | 'success'\|'danger'\|'warning'\|'info'\|... | — | Bootstrap alert variant | | message | string | — | Message body (HTML supported) | | title | string | — | Optional bold title | | dismissible | boolean | false | Show × close button | | autoDismiss | number | 0 | Auto-close after N ms | | icon | string | — | Font Awesome icon class, e.g. 'fa-solid fa-circle-check' | | cssClass | string | — | Extra CSS classes | | style | object | — | Inline styles |

Usage

import { VkAlertComponent, VkAlertConfig } from 'vk-library';

@Component({
  imports: [VkAlertComponent],
  template: `<vk-alert [config]="alert" (dismissed)="onDismiss()" />`
})
export class MyComponent {
  alert: VkAlertConfig = {
    type: 'success',
    title: '¡Guardado!',
    message: 'Los datos se guardaron correctamente.',
    dismissible: true,
    autoDismiss: 4000,
    icon: 'fa-solid fa-circle-check',
  };
}

vk-data-table

Config: VkTableConfig

| Property | Type | Description | |---|---|---| | columns | VkTableColumn[] | Column definitions | | actions | VkTableAction[] | Action buttons per row | | filters | VkTableFilter[] | Filter inputs above the table | | pageSizeOptions | number[] | Default: [5, 10, 25, 50] | | defaultPageSize | number | Default: 10 | | showIndex | boolean | Show row number column | | tableCss | string | Extra classes for <table> | | tableStyle | object | Inline styles for <table> | | rowCss | (row) => string | Dynamic CSS class per row | | rowStyle | (row) => object | Dynamic inline style per row | | defaultSortField | string | Initial sort field | | defaultSortDir | 'asc'\|'desc' | Initial sort direction |

VkTableColumn

| Property | Type | Description | |---|---|---| | field | string | Data key | | header | string | Column header | | sortable | boolean | Enable sorting | | headerCss | string | CSS class for <th> | | cellCss | string | CSS class for <td> | | cellStyle | object | Inline style for <td> | | formatter | (val, row) => string | Value formatter | | html | boolean | Render value as HTML |

VkTableAction

| Property | Type | Description | |---|---|---| | id | string | Action identifier emitted on click | | label | string | Tooltip text | | icon | string | Font Awesome icon class | | btnClass | string | Bootstrap button class (default: btn-outline-secondary) | | style | object | Inline styles | | hidden | (row) => boolean | Hide action for a row | | disabled | (row) => boolean | Disable action for a row |

VkTableFilter

| Property | Type | Description | |---|---|---| | field | string | Field to filter | | placeholder | string | Input placeholder | | type | 'text'\|'select'\|'date' | Filter input type | | options | {label, value}[] | Options for select type |

Usage

import { VkDataTableComponent, VkTableConfig } from 'vk-library';

@Component({
  imports: [VkDataTableComponent],
  template: `
    <vk-data-table
      [config]="tableConfig"
      [data]="rows"
      (actionClick)="onAction($event)"
    />
  `
})
export class MyComponent {
  rows = [
    { id: 1, name: 'Ana', role: 'Admin', active: true },
    { id: 2, name: 'Luis', role: 'User', active: false },
  ];

  tableConfig: VkTableConfig = {
    showIndex: true,
    defaultPageSize: 10,
    defaultSortField: 'name',
    tableCss: 'table-striped table-hover table-bordered',
    columns: [
      { field: 'id', header: 'ID', sortable: true, headerCss: 'text-center', cellCss: 'text-center' },
      { field: 'name', header: 'Nombre', sortable: true },
      { field: 'role', header: 'Rol', cellStyle: { fontWeight: 'bold' } },
      {
        field: 'active', header: 'Estado', html: true,
        formatter: (val) => val
          ? '<span class="badge bg-success">Activo</span>'
          : '<span class="badge bg-danger">Inactivo</span>',
      },
    ],
    actions: [
      { id: 'edit',   label: 'Editar',   icon: 'fa-solid fa-pen',    btnClass: 'btn-outline-primary' },
      { id: 'delete', label: 'Eliminar', icon: 'fa-solid fa-trash', btnClass: 'btn-outline-danger',
        disabled: (row) => !row.active },
    ],
    filters: [
      { field: 'name', placeholder: 'Buscar nombre...' },
      { field: 'role', type: 'select', placeholder: 'Todos los roles',
        options: [{ label: 'Admin', value: 'Admin' }, { label: 'User', value: 'User' }] },
    ],
    rowCss: (row) => row.active ? '' : 'table-secondary',
  };

  onAction({ actionId, row }: { actionId: string; row: any }) {
    if (actionId === 'edit')   console.log('Editar', row);
    if (actionId === 'delete') console.log('Eliminar', row);
  }
}

vk-loading

Config: VkLoadingConfig

| Property | Type | Default | Description | |---|---|---|---| | type | 'spinner'\|'dots'\|'bar'\|'ring' | 'spinner' | Loader style | | size | 'sm'\|'md'\|'lg'\|'xl' | 'md' | Spinner size | | colorClass | string | 'text-primary' | Bootstrap color class | | color | string | — | Custom CSS color (overrides colorClass) | | overlay | boolean | false | Full-screen overlay | | message | string | — | Text below spinner | | cssClass | string | — | Extra CSS classes | | style | object | — | Inline styles |

Usage

import { VkLoadingComponent, VkLoadingConfig } from 'vk-library';

@Component({
  imports: [VkLoadingComponent],
  template: `<vk-loading [config]="loadingConfig" [visible]="isLoading" />`
})
export class MyComponent {
  isLoading = true;

  loadingConfig: VkLoadingConfig = {
    type: 'spinner',
    size: 'lg',
    colorClass: 'text-primary',
    overlay: true,
    message: 'Cargando datos...',
  };
}

License

MIT