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

teatable

v1.3.2

Published

A dynamic table library for web applications, easy manage CRUD operations and more.

Downloads

7

Readme

TeaTable

TeaTable is a JavaScript library that allows you to quickly and easily create dynamic tables for your web applications. It supports CRUD operations, sorting, searching, full-screen display, CSV export, and pagination.

Just add your data and it will facilitate read, create, update, delete, and search operations while also providing a responsive UI.

Installation

To include the library in your project, you can use the following command:

npm i teatable

If you want to use it without importing, you can comment out the 'export default' line in the code and include it in your project.

Features

  • CRUD Operations: Functions for adding, reading, updating, and deleting data.
  • Sorting: Sorting by the relevant column when clicking on each column header.
  • Searching: Instant searching within table data.
  • Full Screen: Displaying the table in full-screen mode.
  • CSV Export: Exporting table data in CSV format.
  • Pagination: Navigating through large data sets page by page.

Usage

To use the library, first import the TeaTable class into your project and create an instance.

import TeaTable from 'teatable';

const options = {
    data: [ // data here
        { id: 1, name: Sample Data 1", extra: "Extra Info 1" },
        { id: 2, name: "Sample Data 2" }
    ],
    themeColor : "#6967ce",

    rowsPerPage: 5, // Optional: Number of rows per page (default: 5)
    // Optional: Callback functions
    onCreate: (newData) => { console.log(newData) },
    onEdit: (id, newData) => { console.log(id, newData) },
    onDelete: (id) => { console.log(id) },
    // language support
    txtAdd     : "Add",
    txtUpdate  : "Update",
    txtDel     : "Delete",
    txtEdit    : "Edit",
    txtAct     : "Actions",
    txtSearch  : "Search...",
    txtPage    : "Page",
    txtConfirm : "Are you sure to delete this data?"
};

const myTable = new TeaTable('tableContainerId', options);

This code creates a table within the HTML element with the specified tableContainerId ID.

Styling

To visually enhance the library, include the following CSS file in your project:

<link rel="stylesheet" href="node_modules/teatable/assets/style.css">

or

import 'teatable/assets/style.css';

What's Next?

  • Dark Mode or Theme Selector ADDED
  • Multilanguage support ADDED
  • Async pagination support

Links

  • NpmJs - https://www.npmjs.com/package/teatable
  • Devto - https://dev.to/hkkcngz/teatable-create-dynamic-crud-table-paginated-sorted-featured-3f0l
  • Github - https://github.com/hkkcngz/teatable
  • CodePen - https://codepen.io/hkkcngz/pen/ZEwMJPo

Donate

Licence

This project is licensed under the MIT License by Hakki Cengiz.