1.0.11 β€’ Published 10 months ago

listing-rez-test-1 v1.0.11

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

πŸ“¦ Installation

To use listing-rez-test-1, install it along with its peer dependencies:

npm install listing-rez-test-1 @tanstack/react-table

Craft Table

listing-rez-test-1 is a highly customizable React table component built on top of TanStack Table. It provides powerful table functionality with features for server-side processing, column management, and additional UI enhancements.

We highly recommend providing a max-height in your CSS for the class ts__table__wrapper, tailored to your requirements, to ensure the best experience.

πŸš€ Features

listing-rez-test-1 supports a wide range of features out of the box:

Core Features

  • Striped layout
  • Compact mode
  • Custom Nested Component.
  • In-built default loader as well as custom loader option.
  • Custom hook that provides all the states of table, for e.g. pagination page size (useCraftTable).
  • Fullscreen mode to focus only on Table contents.
  • Word break all for table content.
  • Column content alignment.

TanStack Table Features

  • Sorting
  • Server Side Sorting
  • Pagination
  • Server Side Pagination
  • Column Reordering (Drag and Drop)
  • Column Sizing
  • Column Resizing
  • Column Pinning
  • Row Selection
  • Toggle column on and off (required Topbar)

πŸ›  Usage

Here’s an example of how to use listing-rez-test-1:

import TableWrapper from 'listing-rez-test-1';

const newData = [
  { id: 1, name: 'John Doe', age: 28 },
  { id: 2, name: 'Jane Doe', age: 34 },
  ];

const defaultColumns = [
  { accessorKey: 'id', header: 'ID' },
  { accessorKey: 'name', header: 'Name' },
  { accessorKey: 'age', header: 'Age' },
  ];

export default function App() {
  return (
    <TableWrapper
      data={newData}
      columns={defaultColumns}
      featureOptions={{
        striped: true,
        enableColumnReordering: true,
        enableColumnPinning: true,
      }}
      loadingOptions={{
        isLoading: false,
        loaderText: "Loading...",
      }}
    />
  );
}

πŸ”§ API Reference

CraftTable

Props

PropTypeDescription
dataArrayThe data to be displayed in the table.
columnsArrayColumn definitions, compatible with TanStack Table.
featureOptionsCraftTableFeaturePropsObject containing feature flags for enabling/disabling specific functionalities.
loadingOptionsLoadingOptionsObject for controlling loading behavior.

CraftTableFeatureProps

FeatureTypeDefaultDescription
enableSortingbooleantrueEnables client-side sorting.
enableServerSideSortingbooleanfalseEnables server-side sorting.
enableServerSidePaginationbooleanfalseEnables server-side pagination.
enableRowSelectionbooleantrueEnables row selection functionality.
enableColumnResizingbooleantrueAllows columns to be resized by dragging.
enableColumnReorderingbooleanfalseAllows columns to be reordered via drag-and-drop.
enableColumnPinningbooleanfalseEnables pinning columns to the left or right of the table.
enableTopbarbooleantrueEnables a custom topbar for the table.
enableWordBreakAllbooleanfalseApplies word-break: break-all to prevent text overflow.
stickyHeaderbooleantrueMakes the table header sticky when scrolling vertically.
compactTablebooleanfalseReduces row height for a compact layout.
stripedbooleanfalseAdds striped row styling for better readability.

LoadingOptions

OptionTypeDefaultDescription
isLoadingbooleanfalseWhether the table is in a loading state.
loaderTextstring"Loading..."Text to display when loading.
loadingComponentReactNodeundefinedCustom loading component to render.

πŸ“˜ Documentation

For detailed documentation and examples, visit the TanStack Table Docs.

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.0

10 months ago