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

@aipng/vuetify-datagrid

v1.0.4

Published

Opiniated and extended version of Vuetify's datagrid component for Vue 3.

Readme

aipng/datagrid

Opiniated and extended version of Vuetify's datagrid component for Vue 3.

Provides sorting, pagination, row selection and row expansion.

This component builds upon Vuetify's foundation while adding more functionality and customization options.

Installation

npm install aipng/datagrid

Datagrid

Usage

<template>
  <TheDatagrid
    :headers="headers"
    :result="result"
    :cursor="cursor"
    :sort-by="sortBy"
    @onCursorChange="handleCursorChange"
    @onSortChange="handleSortChange"
  >
    <!-- Optional slots for custom column rendering -->
    <template #col-name="{ item }">
      {{ item.name }}
    </template>
  </TheDatagrid>
</template>

<script setup lang="ts">
import { TheDatagrid } from 'aipng/datagrid'
import type { DatagridColumnHeader, CursorPosition, SortItem } from 'aipng/datagrid'

const headers: DatagridColumnHeader[] = [
  {
    key: 'id',
    title: '#',
    align: 'center',
    sortable: false,
  },
  {
    key: 'name',
    title: 'Name',
    sortable: true,
  },
]

const result = {
  itemsTotal: 100,
  items: [
    { id: 1, name: 'Item 1' },
    { id: 2, name: 'Item 2' },
  ],
}

const cursor: CursorPosition = {
  page: 1,
  pageSize: 10,
}

const sortBy: SortItem = {
  sort: 'id',
  order: 'desc',
}

const handleCursorChange = (newCursor: CursorPosition) => {
  // Handle page change
}

const handleSortChange = (newSort: SortItem) => {
  // Handle sort change
}
</script>

Props

| Prop | Type | Required | Default | Description | |------|-----|---------|-----------------|-------| | headers | DatagridColumnHeader[] | Yes | - | Column configuration | | result | { itemsTotal: number, items: T[] } | Yes | - | Data to display | | showSelect | boolean | No | false | Show checkbox for row selection | | showExpand | boolean | No | false | Show button for row expansion |

Events

| Event | Parameters | Description | |-------|-----------|-------| | onCursorChange | CursorPosition | Page or page size change | | onSortChange | SortItem | Sort change |

Slots

| Slot | Parameters | Description | |------|-----------|-------| | col-{key} | { item: T } | Custom column rendering | | itemExpandButton | { item: T, isExpanded: boolean, toggleExpand: () => void } | Custom expand button | | expandedRow | { item: T } | Custom expanded row content |

Pagination

The datagrid includes a built-in pagination component that appears when the total number of items exceeds 5. The pagination component is displayed both at the top and bottom of the table for better user experience.

The pagination component accepts the following props:

| Prop | Type | Required | Description | |------|-----|---------|-------| | cursor | CursorPosition | Yes | Current page and page size | | itemsTotal | number | Yes | Total number of items |

And emits the following events:

| Event | Parameters | Description | |-------|-----------|-------| | change | CursorPosition | Emitted when page or page size changes |

Types

DatagridColumnHeader

type DatagridColumnHeader = {
  key: string
  title: string
  align?: 'start' | 'center' | 'end'
  sortable?: boolean
  type?: 'text' | 'number' | 'boolean' | 'date' | 'url' | 'array' | 'email'
  value?: (item: unknown) => string | null
}

CursorPosition

type CursorPosition = {
  page: number
  pageSize: number
}

SortItem

type SortItem = {
  sort: string
  order: 'asc' | 'desc'
}