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 🙏

© 2025 – Pkg Stats / Ryan Hefner

quadra-component

v0.0.6

Published

NPM package for quadra karya santosa developer

Downloads

10

Readme

quadra-component

quadra-component is a React.js library that provides components to to make it easier for quadra developers.

Installation

Install the package via npm:

npm install quadra-component

Install the package via yarn:

yarn add quadra-component

Components

1. Tabel component

This component is used to create tables dynamically and is easy to use and already uses types for the data that appears in the table.

Props

  • data (any[]): This is props of your data.
  • columns (Columns[]): The structure of your table.
  • loading (boolean): The loading state.
  • onRowClick (void function): You can use this function to trigger any action while you click the table body.
  • color (string): You can change the header table background color.
  • textColor (string): You can change the header table text color.

Columns

  • fieldId (string): The key of object in your data.
  • label (string): The title you want to show in header table.
  • render (React function): The render is a function that returns react element, you can use this to manipulate data and you can show the data as you want or you can enhance the look of your table body.
  • renderHeader (React function): The renderHeader is a function that returns react element, you can use this to enhance or change the look of your table header.

Usage

Columns

import { type Columns } from "quadra-component";

const header: Columns<Forum>[] = [
  {
    fieldId: "index",
    label: "No",
  },
  {
    fieldId: "title",
    label: "Title",
  },
  {
    fieldId: "description",
    label: "Description",
    render: (data) => (
      <p>
        {data?.description !== undefined &&
          (data.description.length > 25
            ? data?.description.slice(0, 20) + "..."
            : data?.description)}
      </p>
    ),
  },
  {
    fieldId: "image",
    label: "Post Image",
    render: (data) => <img src={data?.image} alt="Images" />,
  },
  {
    fieldId: "created_at",
    label: "Posted At",
    render: (data) => <p>{moment(data?.created_at).format("MMM Do, YYYY")}</p>,
  },
  {
    fieldId: "likes",
    label: "Total Like",
  },
  {
    fieldId: "moderator",
    label: "Moderator",
  },
  {
    fieldId: "admin",
    label: "Posted By",
    render: (data) => <p>{data?.admin.email}</p>,
  },
];

Table

import { Table } from "quadra-component";

<Table<Forum>
  columns={header}
  data={data}
  loading={isLoading}
/>

2. Pagination component

This component is used when you need pagination for the table

Props

  • currentPage (number): The number of the current page.
  • totalPages (number): The total of your data page.
  • onPageChange (void function): The function that can be used to change your page
  • color (string): You can change the color of pagination.

Usage

import React from "react";
import { Pagination, Table } from "quadra-component";
const App = () =>{
 <>
    <Table<Forum>
      columns={header}
      data={data}
      loading={isLoading}
    />
    <Pagination
      currentPage={data!?.meta.currentPage}
      totalPages={data!?.meta.totalPages}
      onPageChange={handlePageChange}
    />
  </>
}
export default App;

3. Svg Icon Components

This component allows you to changes the svg colors

Props

  • svg (number): The svg you want to change.
  • className (number): The react className.
  • normalWidth (void function): The normal width for 1.5rem / 24px

Usage

import React from "react";
import { SvgIcon } from "quadra-component";
import { ChevronLeftSVG } from "assets/images";
const App = () => {
  <>
    <SVGIcon svg={ChevronLeftSVG} className="bg-red" />
  </>;
};
export default App;

License

This project is licensed under the ISC License.