Components
ReadyTable

ReadyTable Component

The ReadyTable component is a flexible and feature-rich table component for Shopify apps. It's built on top of Shopify Polaris components and provides easy data display with sorting, pagination, and action buttons.

Features

  • Customizable table headings
  • Selectable rows
  • Pagination support
  • Action buttons (Edit and Delete)
  • Responsive design

Usage

import ReadyTable from './path/to/readyTable';
 
const MyPage = () => {
  const data = {
    nodes: [
      { id: '1', name: 'Item 1', status: 'active', createdAt: '2023-01-01' },
      { id: '2', name: 'Item 2', status: 'inactive', createdAt: '2023-01-02' },
    ],
    pageInfo: {
      hasNextPage: true,
      hasPreviousPage: false,
      endCursor: 'cursor123',
    },
  };
 
  const headings = [
    { title: 'Name' },
    { title: 'Status' },
    { title: 'Created At' },
    { title: 'Actions' },
  ];
 
  return (
    <ReadyTable
      data={data}
      headings={headings}
      resourceName={{ singular: 'item', plural: 'items' }}
      pagination={true}
      actions={true}
    />
  );
};

Props

PropTypeDefaultDescription
dataObjectRequiredThe data to display in the table
resourceNameObject{ singular: 'item', plural: 'items' }Names for the resources in the table
headingsArraynullCustom headings for the table
selectableBooleantrueWhether rows can be selected
paginationBooleanfalseWhether to show pagination controls
actionsBooleanfalseWhether to show action buttons