Skip to Content
FrontendBundlesCRUDListingListing Table

ListingTable

The primary view component of the CRUD listing. It renders rows fetched from the API inside a <Table>, supports column sorting, row selection, inline editing, and bulk actions. It reads all shared state from ListingContext and delegates per-row actions to ListingActions.


Import

import ListingTable from "@phpcreation/frontend-crud-react-nextjs-bundle/components/Listing/ListingTable";

Props

PropTypeRequiredDescription
resourcestringYesAPI resource name (e.g. "invoices").
mainColumnsMainColumnsListing[]YesColumn definitions — label, field path, type, sortable flag.
fqcn_buiIFQCN_BUIYesFully-qualified component name used for element IDs.
tenantstringYesTenant identifier passed down to child actions.
localestringNoActive locale, defaults to "en".
formInputsEditFilterField[]NoField definitions used by the inline / quick-edit flow.
formInputsAddFilterField[]NoField definitions used by the quick-duplicate flow.
formInputsShowFilterField[]NoField definitions used by the quick-show modal.
userUser | nullNoAuthenticated user — controls role-gated action visibility.
customActions{ key: string; action: ReactNode }[]NoInject custom action buttons into each row’s action set.

ListingTable must be rendered inside a ListingContext provider. Attempting to use it standalone will throw a context error.


Column Definition

interface MainColumnsListing { key: string; // dot-path into the row object, e.g. "status.title" title: string; // column header label (translated) type: ColumnTypeEnum; // controls how the cell value is rendered sortable?: boolean; // enables click-to-sort on the header className?: string; }

Usage

import ListingTable from "@phpcreation/frontend-crud-react-nextjs-bundle/components/Listing/ListingTable"; import { ColumnTypeEnum } from "@phpcreation/frontend-utils-react-nextjs-bundle/utils/types"; const columns = [ { key: "id", title: "ID", type: ColumnTypeEnum.NUMBER, sortable: true }, { key: "title", title: "Title", type: ColumnTypeEnum.TEXT, sortable: true }, { key: "createdAt", title: "Created",type: ColumnTypeEnum.DATE, sortable: true }, ]; <ListingTable resource="invoices" mainColumns={columns} fqcn_bui={{ Bundle: "BillBundle", Unit: "Invoice", Interface: "listing" }} tenant="acme" locale="en" user={currentUser} />

Inline editing is activated when the row is selected and bunchEditing is true in ListingContext, or when a row enters inlineEditItem state. Always provide formInputsEdit to support inline saves.


Last updated on