Skip to main content

IListViewProps

@spartanfx/react v1.2.2


@spartanfx/react / spfx / IListViewProps

Interface: IListViewProps

Props for the ListView component, a flexible and extensible SharePoint list rendering control.

Supports both traditional DetailsList and responsive TileView, as well as filtering, sorting, searching, exporting, and context menus.

Properties

Required

PropertyTypeDefaultDescription
columnsIListviewColumn[]-An array of columns to be rendered in the view, each mapping to a SharePoint field.
contextWebPartContext-The SPFx web part context required for SharePoint API access and filtering.
listViewServiceListViewService-A configured instance of the ListViewService to interact with the SharePoint list and its items.

Options

PropertyTypeDefaultDescription
disableFiltering?boolean-Disables column-based filtering entirely.
disableSorting?boolean-Disables column-based sorting entirely.
enableColumnSelector?boolean-Enable the column selector feature allowing users to customize visible columns
extendColumns?boolean-Enable the column selector to propose all available columns form the list fields.
forceTileView?boolean-Forces tile view layout regardless of screen width.
hideExport?boolean-Hides the Export to Excel button.
hideSearch?boolean-Hides the search box in the header.
hideSortAndFilterButton?boolean-Hides the sort and filter button in tile view.
highlightedFieldName?string-Field to visually highlight in the tile view.
listViewHeaderText?string-Optional title or header text to show at the top of the list.
selectionMode?SelectionMode-Optional selectionMode. Default value 'none'
showItemCount?boolean-Optional showItemCount. Show the number of total items returned by the listViewService current configuration, including local filters applied.
tileViewFilterSortPaneExclusions?string[]-Field names to exclude from filter/sort pane in tile view.
tileViewFilterSortPaneOpened?boolean-Controls whether the tile view filter/sort pane is open by default.
tileViewTreshold?number1185Threshold below which the tile view is enabled automatically.
translatedFields?string[]-Array of field internal names that require translation of their filter values.
viewId?string-View ID for column persistence (used in localStorage key)

Events & callbacks

PropertyTypeDefaultDescription
onColumnsChanged?(columns) => void-Callback triggered when user changes column configuration Receives the new array of selected columns
onDismissTileViewFilterSortPane?() => void-Callback fired when the tile view filter/sort pane is dismissed.
onItemClick?(item) => void-Optional handler fired when a list item is clicked.
onLoadingStateChanged?(loading) => void-Callback triggered when the loading state changes (e.g., during item fetch).
onRenderItemCount?(itemCount) => Element-Optional onRenderItemCount. Use this to pass a custom renderer for the item count.
onRenderItemCountNumber?(itemCount) => Element-Optional onRenderItemCountContent. Use this to pass a custom renderer to render the item count number.
onRenderListViewControls?() => Element-Allows injecting custom UI controls above the list (e.g., command bar, filters).
onRenderSortAndFilterButton?(hasFilters, onClick) => Element-Allows customization of the Sort/Filter button in tile view.
onRenderTile?(item, columns) => any-Optional custom tile renderer for use with tile view mode. Deprecated Use tileListProps to pass a custom tile renderer
onSelectionChanged?(selectedItems) => any-Optional onSelectionChanged. Ignored if SelectionMode is set to none
translate?(text) => string-Optional translation function for labels like buttons and filters.

Advanced & escape hatches

PropertyTypeDefaultDescription
detailsListProps?Partial<IDetailsListProps>-Optional overrides for Fluent UI's DetailsList props.
extendedSearchBoxProps?Partial<IExtendedSearchBoxProps>-Optional ExtendedSearchBox props.
listViewExportToExcelProps?Partial<IListViewExportToExcelProps>-Optional ListViewExportToExcel props.
tileListProps?Partial<ITileListProps>-Optional TileList props