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

@devtools-bp/ngx-responsive-table

v1.10.0

Published

AN Angular library offering customizable and responsive tables for seamless user experience on all devices. Its flexibility allows users to design tables that fit their project needs with an intuitive API and dynamic data handling. Elevate your Angular ap

Downloads

4

Readme

ngx-responsive-table

An Angular library offering customizable and responsive tables for seamless user experience on all devices. Its flexibility allows users to design tables that fit their project needs with an intuitive API and dynamic data handling. Elevate your Angular applications with this powerful table solution.

Demo 🚀

Check it out -> ngx-responsive-table 💣

Installation

npm install @devtools-bp/ngx-responsive-table

or

yarn add @devtools-bp/ngx-responsive-table

Configuration

To use the ngx-responsive-table you need to import styles from the package itself.

@import 'node_modules/ngx-responsive-table/assets/styles/default';

Usage

In Component

import { Component, inject } from '@angular/core';
import { AsyncPipe, NgOptimizedImage } from '@angular/common';

import { UserService } from './user.service';
import { NgxResponsiveTableComponent } from '@devtools-bp/ngx-responsive-table';

@Component({
  standalone: true,
  imports: [NgxResponsiveTableComponent, AsyncPipe, NgOptimizedImage],
  selector: 'root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  user$ = inject(UserService).users$;
}

In HTML

Default Table
<ngx-responsive-table [data]="user$ | async" caption="default table" />
Custom Header Labels

It is important to note with custom headers you need to add #headers to your template.

<ngx-responsive-table [data]="user$ | async" caption="Custom Header Labels">
  <ng-template #headers>
    <th>Avatar</th>
    <th>Email</th>
    <th>First Name</th>
    <th>ID</th>
    <th>Last Name</th>
  </ng-template>
</ngx-responsive-table>
Custom Cells

It is important to note that with custom cells you will need to add data-cell attribute to each custom cell (table td element) and the #rows with let-row to access the table data.

<ngx-responsive-table [data]="user$ | async" caption="Custom Cells">
  <ng-template #headers>
    <th>Avatar</th>
    <th>Email</th>
    <th>First Name</th>
    <th>ID</th>
    <th>Last Name</th>
    <th>Actions</th>
  </ng-template>
  <ng-template #rows let-row>
    <td data-cell="avatar">
      <img
        [ngSrc]="row.avatar"
        alt="Avatar"
        class="avatar"
        width="50"
        height="50"
      />
    </td>
    <td data-cell="email">{{ row.email }}</td>
    <td data-cell="first_name">{{ row.first_name }}</td>
    <td data-cell="id">{{ row.id }}</td>
    <td data-cell="last_name">{{ row.last_name }}</td>
    <td data-cell="actions" id="actions">
      <button data-cell="edit">Edit</button>
      <button data-cell="delete">Delete</button>
    </td>
  </ng-template>
</ngx-responsive-table>

Styles

.avatar {
  vertical-align: middle;
  border-radius: 50%;
}

button {
  padding: 8px 12px;
  border: none;
  background-color: #995b00;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  margin: 0.5rem;
}

button:hover {
  background-color: #ff9800;
}

@media (max-width: 650px) {
  .avatar {
    vertical-align: center;
  }

  #actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0 0.5rem;
  }

  #actions:before {
    content: '';
  }
}

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository. Learn how to contribute to the project.

License

The devtools-bp monorepo is released under the MIT License. Please make sure you understand its terms and conditions when using the libraries and tools provided in this repository.

Authors