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

sms-ui-library

v11.0.8

Published

To import CSS, use:

Downloads

9,644

Readme

To import CSS, use:

import "@digitus-sms/form-controls/style.css";
import { StatusBadge } from "@digitus-sms/form-controls";

export default function Example() {
  return <StatusBadge status="Approved" />;
}
const statusConfig = {
  approved: {
    label: "Approved",
    bgColor: "#0D01FF",
    textColor: "#0D01FF",
    dotColor: "#0D01FF",
    borderColor: "#0D01FF",
  },
  rejected: {
    label: "Rejected",
    bgColor: "#F04438",
    textColor: "#F04438",
    dotColor: "#F04438",
    borderColor: "#F04438",
  },
  "response pending": {
    label: "Response Pending",
    bgColor: "#F79009",
    textColor: "#F79009",
    dotColor: "#F79009",
    borderColor: "#F79009",
  },
};
<StatusBadge
  status="approved"
  config={statusConfig}
/>

Props

| Prop | Type | Default | Description | | ---------------- | ----------------------------- | ------------ | ------------------------------------ |

|status |string | undefined | Status text | |config |Record<string, StatusConfig> | undefined | Status → style mapping | |className |string | undefined | Optional wrapper class |

Components

TablePaginator

A fully controlled, self-contained pagination component designed to work alongside PrimeReact's DataTable (or any table).


Usage



const MyTable = () => {
  const [rows, setRows] = useState(10);
  const [first, setFirst] = useState(0);
  const [inputValue, setInputValue] = useState<number | string>(1);
  const totalRecords = 500;
  const totalPages = Math.ceil(totalRecords / rows);

  const handlePageChange = (e: PaginatorPageChangeEvent) => {
    setFirst(e.first);
    setRows(e.rows);
    setInputValue(e.page + 1);
  };

  const handleRowsChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
    setRows(Number(e.target.value));
    setFirst(0);
    setInputValue(1);
  };

  const handlePageInput = (e: React.ChangeEvent<HTMLInputElement>) => {
    setInputValue(e.target.value);
  };

  const handlePageKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
    if (e.key === 'Enter') {
      const page = Number(inputValue);
      if (page >= 1 && page <= totalPages) {
        setFirst((page - 1) * rows);
      }
    }
  };

  const handlePageBlur = () => {
    const page = Number(inputValue);
    if (page >= 1 && page <= totalPages) {
      setFirst((page - 1) * rows);
    } else {
      setInputValue(Math.floor(first / rows) + 1); // reset to current page
    }
  };

  return (
    <>
      {/* Your DataTable here — remove paginator and paginatorTemplate props */}

      <TablePaginator
        currentPage={Math.ceil(first / rows) + 1}
        rows={rows}
        totalRecords={totalRecords}
        inputValue={inputValue}
        onPageChange={handlePageChange}
        onRowsChange={handleRowsChange}
        onPageInput={handlePageInput}
        onPageKeyDown={handlePageKeyDown}
        onPageBlur={handlePageBlur}
      />
    </>
  );
};

Props

| Prop | Type | Required | Default | Description | |---|---|---|---|---| | currentPage | number | ✅ | — | Current active page (1-based) | | rows | number | ✅ | — | Number of rows per page | | totalRecords | number | ✅ | — | Total number of records across all pages | | inputValue | number \| string | ✅ | — | Controlled value of the jump-to-page input | | onPageChange | (e: PaginatorPageChangeEvent) => void | ✅ | — | Called when user navigates via any button | | onRowsChange | (e: ChangeEvent<HTMLSelectElement>) => void | ✅ | — | Called when user changes rows-per-page | | onPageInput | (e: ChangeEvent<HTMLInputElement>) => void | ✅ | — | Called on every keystroke in the page input | | onPageKeyDown | (e: KeyboardEvent<HTMLInputElement>) => void | ✅ | — | Called on keydown (use for Enter key handling) | | onPageBlur | () => void | ✅ | — | Called when the page input loses focus | | rowsPerPageOptions | number[] | ❌ | [10, 25, 50, 100] | Options shown in the rows-per-page dropdown | | className | string | ❌ | — | Extra className applied to the root wrapper |


PaginatorPageChangeEvent

This type is exported from the library — no need to install PrimeReact just for the type.

import type { PaginatorPageChangeEvent } from 'sms-ui-library';

interface PaginatorPageChangeEvent {
  first: number;      // index of the first record on this page (0-based)
  rows: number;       // rows per page
  page: number;       // current page index (0-based)
  pageCount: number;  // total number of pages
}

Using with PrimeReact DataTable

Remove paginator and paginatorTemplate from DataTable and place TablePaginator directly below it:

<DataTable
  value={data}
  lazy
  first={first}
  rows={rows}
  totalRecords={totalRecords}
  onPage={handlePageChange}
  // ❌ do NOT pass paginator or paginatorTemplate
>
  {/* columns */}
</DataTable>

<TablePaginator
  currentPage={Math.ceil(first / rows) + 1}
  rows={rows}
  totalRecords={totalRecords}
  inputValue={inputValue}
  onPageChange={handlePageChange}
  onRowsChange={handleRowsChange}
  onPageInput={handlePageInput}
  onPageKeyDown={handlePageKeyDown}
  onPageBlur={handlePageBlur}
/>

Peer Dependencies

{
  "react": ">=17",
  "react-dom": ">=17"
}

License

MIT