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

@fidurcode/dashboard-widgets-skeleton

v2.1.14

Published

Reusable Angular components and services for building dynamic dashboard widgets with configurable layout, responsive sizing, and focused edit controls.

Readme

@fidurcode/dashboard-widgets-skeleton

Reusable Angular components and services for building dynamic dashboard widgets with configurable layout, responsive sizing, and focused edit controls.


Requirements

  • Angular ^22.0.0
  • Node.js >=26.0.0

This package is built from a workspace using Angular CLI ^22.0.1, @angular/build:ng-packagr, ng-packagr ^22.0.0, and TypeScript ^6.0.3.


📦 Installation

npm install @fidurcode/dashboard-widgets-skeleton

🚀 Usage

Import the module:

import { DashboardWidgetsSkeletonModule } from '@fidurcode/dashboard-widgets-skeleton';

@NgModule({
  imports: [DashboardWidgetsSkeletonModule],
})
export class AppModule {}

Use in template:

<fidurcode-dashboard-widgets
  [title]="'My Dashboard'"
  [widgets]="widgets"
  [rowHeight]="80"
  [widgetPadding]="12"
  (widgetChange)="onWidgetChange($event)">
</fidurcode-dashboard-widgets>

🧩 Components Overview


DashboardWidgetsComponent

Selector: fidurcode-dashboard-widgets

Main container component. Manages layout, persistence (localStorage), and edit mode.

Inputs

| Name | Type | Default | Description | |----------------|--------------------|----------------------|--------------------------------------------------| | title | string | (required) | Dashboard header title | | widgets | Widget[] | (required) | Available widget definitions | | storageKey | string | 'dashboard-widgets'| localStorage key for persisting layout | | columns | number or 'auto' | 'auto' | Grid column count or 'auto' for responsive fit | | minTileWidth | number | 200 | Minimum tile width in px (used in auto mode) | | rowHeight | number | 80 | Row height in px | | gap | number | 12 | Gap between widgets in px | | maxColumns | number | 4 | Maximum columns available in widget options | | maxRows | number | 4 | Maximum rows available in widget options | | widgetPadding| number | 12 | Padding inside widget content area in px | | editMode | boolean | true | Initial edit mode state |

Outputs

| Name | Type | Description | |----------------|------------|--------------------------------------------------| | widgetChange | Widget[] | Emits the current widget list on every change |


WidgetComponent

Selector: app-widget

Individual widget wrapper. Renders dynamic content and provides a header with action buttons.

Inputs

| Name | Type | Required | Description | |--------|----------|----------|--------------------------------| | data | Widget | ✅ Yes | Widget configuration object |

Content contract

Every component passed as widget content must expose a widgetSize input. The dashboard updates it with the actual content area available inside the widget.

import { Component, input, InputSignal } from '@angular/core';
import {
  DashboardWidgetContentComponent,
  DashboardWidgetContentSize,
} from '@fidurcode/dashboard-widgets-skeleton';

@Component({
  selector: 'app-sales-widget',
  template: '<section class="sales-widget">...</section>',
  styles: [`
    :host,
    .sales-widget {
      display: block;
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      box-sizing: border-box;
    }
  `],
})
export class SalesWidgetComponent implements DashboardWidgetContentComponent {
  widgetSize: InputSignal<DashboardWidgetContentSize> = input.required();
}

The content component should render within width: 100% and height: 100%; use the numeric widgetSize.width, widgetSize.height, widgetSize.rows, and widgetSize.columns values for charts, canvases, tables, or other components that need explicit dimensions.


WidgetOptionsComponent

Selector: app-widget-options

Settings overlay rendered inside the widget. Visible only in edit mode.

Features

  • Resize — toggle group for columns (width) and rows (height)
  • Delete — removes widget from dashboard
  • Move left/right — reorders widget in the grid

🏗️ Widget Interface

interface Widget {
  id: number;
  label: string;              // translation key
  content: Type<DashboardWidgetContentComponent>;
  rows?: number;
  columns?: number;
  defaultRows?: number;       // initial rows when widget is first added
  defaultColumns?: number;    // initial columns when widget is first added
}

🌍 Required Translation Keys

Add the following keys to your ngx-translate translation files:

{
  "DASHBOARD": {
    "ADD_WIDGET": "Add widget",
    "NO_WIDGETS": "No widgets available",
    "LOCK": "Lock dashboard",
    "UNLOCK": "Unlock dashboard"
  },
  "WIDGET": {
    "WIDTH": "Width",
    "HEIGHT": "Height",
    "DELETE": "Delete",
    "MOVE_LEFT": "Move left",
    "MOVE_RIGHT": "Move right",
    "CLOSE_OPTIONS": "Close",
    "SETTINGS": "Settings"
  }
}

Widget label fields are also treated as translation keys and resolved at runtime.


💾 Layout Persistence

The dashboard automatically saves and restores widget state via localStorage using the storageKey input. Persisted state includes position order, rows, and columns.

The format is backward compatible — dashboards saved with v1.4.x (IDs only) are migrated automatically on first load.