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

@sito/dashboard

v0.0.53

Published

UI library with custom components for dashboards

Readme

@sito/dashboard

A React library for building customizable and responsive dashboards with ease.

Features

  • Table Component: A powerful table component with support for sorting, pagination, and customizable columns.
  • Translation Support: Built-in translation support using a TranslationProvider.
  • Customizable: Easily style and configure components to fit your needs.
  • Lightweight: Optimized for performance and usability.

Installation

To install the library, use npm or yarn:

# Using npm
npm install @sito/dashboard

# Using yarn
yarn add @sito/dashboard

Table

Here’s how you can use the Table component in your project:

import React from "react";
import { Table } from "sito-dashboard";

const App = () => {
  const rows = [
    { id: 1, name: "John Doe", age: 30 },
    { id: 2, name: "Jane Smith", age: 25 },
  ];

  const columns = [
    { key: "name", label: "Name" },
    { key: "age", label: "Age" },
  ];

  return (
    <Table
      title="User Table"
      data={rows}
      columns={columns}
    />
  );
};

export default App;

Translation for its components

Wrap your application with the TranslationProvider to enable translations:

import React from "react";
import { TranslationProvider } from "@sito/dashboard";

const translations = {
  en: { hello: "Hello" },
  es: { hello: "Hola" },
};

const App = () => {
  const t = (key) => translations["en"][key]; // Example translation function

  return (
    <TranslationProvider t={t}>
      <h1>{t("hello")}</h1>
    </TranslationProvider>
  );
};

export default App;

Components

Table

The Table component is a flexible and feature-rich table for displaying data.

Props

| Propiedad | Tipo | Valor por defecto | Descripción | |-----------------------|---------------|-------------------------|--------------------------------------------------------------------| | title | string | "" | El título de la tabla. | | data | array | — | Los datos a mostrar en la tabla. | | columns | array | [] | Definiciones de columnas, incluyendo claves (key) y etiquetas. | | isLoading | boolean | false | Indica si la tabla está en estado de carga. | | actions | ActionType[] | — | Función para renderizar acciones por fila. | | className | string | "" | Clase personalizada para el contenedor de la tabla. | | contentClassName | string | "" | Clase personalizada para el contenido de la tabla. | | softDeleteProperty | string | "deleted" | Propiedad usada para lógica de borrado suave. | | toolbar | ReactNode | <></> | Componente personalizado para la barra de herramientas. | | onSort | function | — | Callback que se llama cuando se cambia el orden de la tabla. |

TranslationProvider

Provides translation support for your application.

Props

  • t (function): A translation function that takes a key and returns the translated string.

Examples

Columns definition

  key: string;
  label: string;
  sortable?: boolean;
  sortOptions: {
    icons: {
      className: string;
      asc: string;
      desc: string;
    };
  };
  className?: string;
  display?: "visible" | "none";
  pos?: number;
  renderBody?: (value: any, row: any) => ReactNode;
  renderHead?: () => void;
  filterOptions?: ColumnFilterOptions;

ColumnFilterOptions

{
  type: FilterTypes;
  defaultValue: any;
  label?: string;
}

FilterTypes enum

text,
number,
select,
autocomplete,
date,
check,
import { Table } from "@sito/dashboard";

const columns = [
  {
    key: "tagIds",
    label: t("_entities:news.tags.label"),
    filterOptions: {
      type: FilterTypes.autocomplete,
      options: tagsList,
      defaultValue: [],
    },
    sortable: false,
    renderBody: (_, news) =>
      (
        <div className="flex flex-wrap gap-3">
          {news.tags?.map(({ name, id }) => (
            <Chip key={id} label={name} spanClassName="text-xs" />
          ))}
        </div>
      ) ?? " - ",
  },
]

<Table data={...} columns={columns} />

Actions definition

{
  id: string;
  onClick: (entity: object) => void;
  icon: any;
  tooltip: string;
  hidden: (entity: object) => boolean;
}
import { Table } from "@sito/dashboard";

const addAction = {
  id: "add",
  hidden: false,
  onClick: async () => {
    // do some stuff here
  },
  icon: (
    <FontAwesomeIcon
      icon={isLoading ? faSpinner : faAdd}
      className={`text-success ${isLoading ? "rotate" : ""}`}
    />
  ),
  tooltip: t("_accessibility:buttons.add"),
}

<Table data={...} columns={...} actions={[addAction]} />

Your custom toolbar

import { Table } from "@sito/dashboard";

const Toolbar = () => {
  return <div>
    <h1>My custom toolbar</h1>
  </div>
}

<Table data={...} columns={...} toolbar={<Toolbar />} />

Development

Running Locally

To run the project locally:

  1. Clone the repository:
git clone https://github.com/your-repo/sito-dashboard.git

cd sito-dashboard
  1. Install dependencies:
npm install
  1. Start the development server
npm start

Building the Library

To build the library for production

npm run build

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Submit a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License.