Skip to main content

List Order Table Block

ListOrderTable is an order management table built on BaseTable, with searchable header actions, optional search chips, tabs, row actions, and pagination.

Installation​

npm install @nodeblocks/frontend-list-order-table-block

What You Need​

ItemWhy it matters
labelsCopy for search/filter controls, columns, row actions, and empty state
dataTable rows (ListOrderTableRowData)
listOrderTableTitleHeader title
tabs + currentTab + onTabChange (optional)Filter rows by tab key
searchValue + search chips + handlers (optional)Controlled search input, chip list, and submit/delete flow
pagination (optional)Controlled page state
row actions + handlers (optional)labels.rowActions + resolveRowAction + action handlers
Controlled component

ListOrderTable does not own tab/search/pagination state. Keep currentTab, search draft/chips, and pagination in your app, then pass handlers (onTabChange, onSearchFieldChange, onSearchSubmit, pagination.onPageChange) to update state.

Code Examples​

Live Editor
function Example() {
  const allOrderData = Array.from({length: 20}, (_, i) => ({
    id: String(i + 1),
    createdAt: new Date(2024, 0, i + 1).toISOString(),
    ordererName: `ORD-${String(i + 1).padStart(3, '0')}`,
    ordererNameRuby: `ă‚ȘăƒŒăƒ€ăƒŒ ${i + 1}`,
    title: `Order ${i + 1}`,
    status: ['pending', 'processing', 'accepted', 'canceled'][i % 4],
  }));

  const tabs = [
    {key: 'pending', label: 'Pending'},
    {key: 'processing', label: 'Processing'},
    {key: 'accepted', label: 'Accepted'},
    {key: 'canceled', label: 'Canceled'},
  ];

  const labels = {
    emptyStateMessage: 'No orders found',
    searchFieldPlaceholder: 'Search orders...',
    actions: {filter: 'Filter'},
    headerRow: {createdAt: 'Created', title: 'Title', ordererName: 'Orderer'},
    rowActions: {
      markProcessing: 'Mark Processing',
      cancelOrder: 'Cancel Order',
      acceptOrder: 'Accept Order',
      revertToPending: 'Revert to Pending',
      sendMessage: 'Send message',
    },
  };

  const [currentTab, setCurrentTab] = React.useState('pending');
  const [searchValue, setSearchValue] = React.useState('');
  const [currentPage, setCurrentPage] = React.useState(1);
  const [lastAction, setLastAction] = React.useState('Search, filter, and row actions will show inline feedback here.');
  const itemsPerPage = 5;

  const filtered = allOrderData.filter(row => row.status === currentTab);
  const totalPages = Math.max(1, Math.ceil(filtered.length / itemsPerPage));
  const start = (currentPage - 1) * itemsPerPage;
  const data = filtered.slice(start, start + itemsPerPage);

  return (
    <>
      <ListOrderTable
        listOrderTableTitle="Order Management"
        labels={labels}
        data={data}
        tabs={tabs}
        currentTab={currentTab}
        onTabChange={tab => {
          setCurrentTab(tab);
          setCurrentPage(1);
        }}
        searchValue={searchValue}
        onSearchFieldChange={setSearchValue}
        onSearchSubmit={() => setLastAction(`Search submitted: ${searchValue}`)}
        onFilterButtonClick={() => setLastAction('Filter clicked')}
        pagination={{
          currentPage,
          totalPages,
          onPageChange: setCurrentPage,
        }}
        rowHref={row => `/orders/${row.id}`}
        onNavigate={to => setLastAction(`Navigate: ${to}`)}
      />
      <div style={{marginTop: 12, color: '#475569', fontSize: 13}}>{lastAction}</div>
    </>
  );
}
Result
Loading...

Important Props​

Core Props​

PropTypeRequiredDefaultDescription
labels{ emptyStateMessage: string; searchFieldPlaceholder: string; actions: { filter: string }; headerRow: { createdAt: string; title: string; ordererName: string }; rowActions?: { markProcessing: string; cancelOrder: string; acceptOrder: string; revertToPending: string; sendMessage: string } }Yes-UI copy for table, actions, and empty state
dataListOrderTableRowData[]Yes-Table rows
listOrderTableTitleReactNodeYes-Header title
isLoadingbooleanNoundefinedLoading state for content/pagination
searchValuestringNoundefinedControlled search input value
onSearchFieldChange(value: string) => voidNoundefinedSearch input change handler
onSearchSubmit() => voidNoundefinedTriggered by search icon click or Enter key
onFilterButtonClick() => voidNoundefinedFilter button handler
searchChipsTitleReactNodeNoundefinedLabel above active search chips
searchChipsBaseTableSearchChip[]NoundefinedActive search chips
onSearchChipDelete(chip: BaseTableSearchChip, index: number, event: SyntheticEvent) => voidNoundefinedRemove-chip handler
tabs{ key: string; label: string; isDisabled?: boolean; subtitle?: string }[]No[{ key: 'pending', label: 'Pending' }, { key: 'processing', label: 'Processing' }, { key: 'accepted', label: 'Accepted' }, { key: 'canceled', label: 'Canceled' }]Tab definitions
currentTabstringNofirst tabs keyActive tab key
onTabChange(tab: string) => voidNoundefinedTab change handler
pagination{ currentPage: number; totalPages: number; onPageChange: (page: number) => void; className?: string }NoundefinedPage controls (pages are counted from 1)
rowHref(row: ListOrderTableRowData) => stringNoundefinedBuild row link; requires onNavigate
onNavigate(to: string) => voidNoundefinedCalled when row click resolves rowHref
shouldShowDropdownMenu(row: ListOrderTableRowData) => booleanNoundefinedHide/show row menu per row
resolveRowAction(row: ListOrderTableRowData) => ('markProcessing' | 'cancelOrder' | 'acceptOrder' | 'revertToPending' | 'sendMessage')[] | undefinedNoundefinedRow action types to render
onOrderProcessing(id: string, title?: string) => voidNoundefinedHandler for markProcessing action
onOrderCanceled(id: string, title?: string) => voidNoundefinedHandler for cancelOrder action
onOrderAccepted(id: string, title?: string) => voidNoundefinedHandler for acceptOrder action
onOrderRevertedToPending(id: string, title?: string) => voidNoundefinedHandler for revertToPending action
onOrderMessageSent(id: string, title?: string) => voidNoundefinedHandler for sendMessage action

ListOrderTableRowData shape:

PropTypeRequiredDefaultDescription
createdAtstringYes-ISO datetime string used in created-at column
idstringYes-Unique row id
ordererNamestringYes-Main orderer name text
ordererNameRubystringNoundefinedOptional second line under ordererName
titlestringYes-Order title
statusstringYes-Status string carried with the row data

Content Props​

labels keys:

PropTypeRequiredDefaultDescription
labels.emptyStateMessagestringYes-Empty table message
labels.searchFieldPlaceholderstringYes-Search input placeholder
labels.actions.filterstringYes-Filter button label
labels.headerRow.createdAtstringYes-Created-at header
labels.headerRow.titlestringYes-Title header
labels.headerRow.ordererNamestringYes-Orderer header
labels.rowActions.markProcessingstringNoundefinedRow action label
labels.rowActions.cancelOrderstringNoundefinedRow action label
labels.rowActions.acceptOrderstringNoundefinedRow action label
labels.rowActions.revertToPendingstringNoundefinedRow action label
labels.rowActions.sendMessagestringNoundefinedRow action label

Subcomponents:

ComponentPropTypeRequiredDefaultDescription
TitlelistOrderTableTitleReactNodeNoRoot listOrderTableTitleTitle text (children wins)
TitlechildrenReactNodeNoRoot titleCustom title markup
Actionlabels{ searchFieldPlaceholder: string; actions: { filter: string } }NoRoot labelsSearch input + filter action copy
ActionsearchValuestringNoRoot searchValueControlled search input
ActiononSearchFieldChange(value: string) => voidNoRoot handlerSearch input change
ActiononSearchSubmit() => voidNoRoot handlerSearch submit
ActiononFilterButtonClick() => voidNoRoot handlerFilter click
ActionchildrenReactNodeNoBuilt search + filter controlsCustom action content
SearchChipssearchChipsTitleReactNodeNoRoot searchChipsTitleChips group title
SearchChipssearchChipsBaseTableSearchChip[]NoRoot searchChipsChips data
SearchChipsonSearchChipDelete(chip, index, event) => voidNoRoot handlerDelete-chip callback
TabsvaluestringNoRoot currentTabOverride active tab value
TabsonChangeTabsProps['onChange']NoRoot onTabChangeMUI tab change callback
TabstabPropsMUI Tab props excluding label, value, and disabledNoundefinedProps forwarded to each MUI tab
TablecolumnsBaseTableColumn<ListOrderTableRowData>[]NoFrom labels.headerRowOverride grid columns
TablerowActions(row: ListOrderTableRowData) => BaseTableRowAction<ListOrderTableRowData>[]NoGenerated from row-action propsOverride row actions
TableactionColumnBaseTableActionColumnNo{ pin: 'right' } when row actions existAction column config
TablerowMenuReactNode or functionNoDefault menuCustom row menu UI
TableonRowClick(row: ListOrderTableRowData) => voidNoDerived from rowHref + onNavigateRow click callback
LoaderchildrenReactNodeNoDefault loaderLoading content
Paginationpagination{ currentPage: number; totalPages: number; onPageChange: (page: number) => void; className?: string }NoRoot paginationPagination controls
PaginationdataListOrderTableRowData[]NoRoot dataRow count source
PaginationisLoadingbooleanNoRoot isLoadingHides pagination while loading and when no rows exist

Title, Action, Header, Loader, SearchChips, Tabs, Content, Table, and Pagination are ListOrderTable.Title, etc. ListOrderTable.Tabs reads the tab definitions from the root tabs prop.

Layout and Composition Props​

PropTypeRequiredDefaultDescription
childrenBlocksOverride | ReactNodeNoundefinedCompound JSX children or function override returning blocks and blockOrder
classNamestringNoundefinedClass on root container (nbb-list-order-table-container)
sxSxPropsNoundefinedMUI system styles for root

ListOrderTable renders a BaseTable root with headerTitle, headerActions, tabs, rows, row actions, no-rows overlay, and optional pagination. It inherits StackProps passthrough (except children). defaultBlockOrder is header, searchChips, tabs, content, pagination.

Default UI Blocks​

BlockBuilt onNotes
ListOrderTable (root)BaseTableRoot table wrapper
ListOrderTable.TitleBaseTable.Header.TitleTitle from listOrderTableTitle
ListOrderTable.ActionBaseTable.Header.Actions + TextField + ButtonSearch field + filter button
ListOrderTable.HeaderBaseTable.HeaderWraps title/actions
ListOrderTable.SearchChipsBaseTable.SearchChipsActive keyword chips block
ListOrderTable.TabsBaseTable.TabsTab navigation from tabs
ListOrderTable.LoaderBaseTable.Content.LoaderLoading state
ListOrderTable.ContentBaseTable.ContentContent wrapper
ListOrderTable.TableBaseTable.Content.GridData grid with default columns/actions
ListOrderTable.PaginationBaseTable.PaginationPage controls
no-rows overlay iconPersonOutlinedUsed when data is empty

TypeScript​

import {ListOrderTable, ListOrderTableRowData, BaseTableSearchChip} from '@nodeblocks/frontend-list-order-table-block';

const rows: ListOrderTableRowData[] = [
{
id: '1',
createdAt: new Date().toISOString(),
ordererName: 'ORD-001',
ordererNameRuby: 'ă‚ȘăƒŒăƒ€ăƒŒ 1',
title: 'Order 1',
status: 'pending',
},
];

const chips: BaseTableSearchChip[] = [{key: 'keyword-1', label: 'ORD-001'}];

<ListOrderTable
listOrderTableTitle="Order Management"
labels={{
emptyStateMessage: 'No orders found',
searchFieldPlaceholder: 'Search orders...',
actions: {filter: 'Filter'},
headerRow: {createdAt: 'Created', title: 'Title', ordererName: 'Orderer'},
}}
data={rows}
searchChipsTitle="Search Keywords"
searchChips={chips}
/>;