Table API

This page provides an overview of the Table component API, detailing its props, emits, slots, and exposed methods/states.

Props

The Table component accepts the following props:

PropDefaultTypeDescription
mode"outlined"StyleModeThe styling mode of the table.
dataSource[]Array<any>The data source for the table.
toolbarundefinedIToolbar or booleanToolbar configuration or visibility toggle.
editundefinedbooleanEnables inline editing for table cells.
sortundefinedISort or booleanSorting configuration or visibility toggle.
filterundefinedIFilter or booleanFiltering configuration or visibility toggle.
groupingundefinedIGrouping or stringGrouping configuration or group field name.
resizedColumnsundefinedbooleanEnables column resizing.
paginationundefinedTablePagination or booleanPagination configuration or visibility toggle.
searchundefinedbooleanEnables search functionality.
columnsundefinedArray<IColumn> or booleanConfiguration for table columns.
summaryundefinedArray<ISummary> or booleanConfiguration for summary rows.
countVisibleRows0numberNumber of rows visible in the table.
sizeLoadingRows5numberNumber of loading rows displayed during data fetching.
noData"No data"stringMessage displayed when there is no data.
noColumn"No columns"stringMessage displayed when no columns are defined.
countDataOnLoading1000numberNumber of rows simulated during data loading.
totalCountundefinednumberTotal number of rows in the data source.
class""StyleClassCustom CSS class for the table container.
stylesundefinedITableStylesCustom styles configuration for the table.

IToolbar

The IToolbar interface defines the configuration for the toolbar in the Table component.

PropertyTypeDescription
visibleboolean or undefinedIndicates whether the toolbar is visible.
searchboolean or undefinedEnables or disables the search input in the toolbar.

ISort

The ISort interface defines the sorting configuration for the Table component.

PropertyTypeDescription
visibleboolean or undefinedIndicates whether sorting is enabled.
icon"Bars" or "Arrow" or undefinedSpecifies the icon to use for sorting (e.g., Bars or Arrow).

IFilter

The IFilter interface defines the filtering configuration for the Table component.

PropertyTypeDescription
visibleboolean or undefinedIndicates whether filtering is enabled.
noFilterstring or undefinedMessage displayed when no filters are applied.
isClearAllFilterboolean or undefinedEnables a "clear all filters" option.

IGrouping

The IGrouping interface defines the grouping configuration for the Table component.

PropertyTypeDescription
visibleboolean or undefinedIndicates whether grouping is enabled.
groupFieldstring or undefinedSpecifies the field used for grouping data.

TablePagination

The TablePagination interface defines the pagination configuration for the Table component.

PropertyTypeDescription
visibleboolean or undefinedIndicates whether pagination is visible.
startPagenumber or undefinedThe starting page for pagination.
Other inherited propsOmitted from PaginationPropsExcludes total and modelValue from the PaginationProps.

IColumn

The IColumn type represents the configuration for a column in the Table component.

PropertyTypeDescription
dataFieldDataField or undefinedThe field in the data source corresponding to this column.
namestring or undefinedThe internal name of the column.
captionstring or undefinedThe caption displayed in the column header.
visibleboolean or undefinedControls the visibility of the column.
widthnumber or undefinedThe width of the column in pixels.
minWidthnumber or undefinedThe minimum width of the column in pixels.
maxWidthnumber or undefinedThe maximum width of the column in pixels.
isFilterboolean or undefinedIndicates whether filtering is enabled for the column.
isSortboolean or undefinedIndicates whether sorting is enabled for the column.
isResizedboolean or undefinedIndicates whether the column can be resized.
defaultFilterany or undefinedThe default filter value for the column.
defaultSortSort or undefinedThe default sorting order for the column.
maskBaseInputProps["maskInput"] or undefinedInput mask applied to the column values.
cellTemplatestring or undefinedTemplate for rendering cell content in the column.
setCellValue(column: IColumn, value: any, data?: any) => anySets the value of a cell in the column.
classobjectCustom CSS classes for various parts of the column (header, cells, etc.).
type"string" or "number" or
"select" or "date"
The type of data the column represents.
editEditInput or EditSelect or EditDate or boolean or undefinedConfiguration for inline editing in the column.

ISummary

The ISummary interface defines the configuration for summary rows in the Table component.

PropertyTypeDescription
dataFieldstring or undefinedThe field for which the summary is calculated.
namestring or undefinedThe name of the summary.
displayFormatstring or "Sum: {0}" or "Min: {0}" or "Max: {0}" or "Avg: {0}" or "Count: {0}" or undefinedThe display format for the summary.
type"sum" or "min" or "max" or "avg" or "count" or undefinedThe type of summary calculation (e.g., sum, min, max, etc.).
dataTypeDataType or undefinedThe data type for the summary.
customizeText(summary: ISummary, result: string) => string or undefinedFunction to customize the summary text.

ITableStyles

The ITableStyles interface defines the overall styles and configuration for the Table component.

PropertyTypeDescription
classITableStylesClass or undefinedCSS class styles for various parts of the Table component.
widthTWidth or undefinedThe width of the table.
heightTHeight or undefinedThe height of the table.
animation"transition-all duration-500" or "transition-none" or string or undefinedAnimation style applied to the table.
hoverRowsstring or "hover:bg-neutral-100/90 dark:hover:bg-neutral-900/50" or boolean or undefinedHover styles for table rows.
isStripedRowsboolean or undefinedIndicates whether striped rows are enabled.
horizontalLinesboolean or undefinedIndicates whether horizontal lines are displayed between rows.
verticalLinesboolean or undefinedIndicates whether vertical lines are displayed between columns.
borderRadiusPxnumber or undefinedThe border radius applied to the table.
heightCellnumber or undefinedThe height of table cells.
filterLinesboolean or undefinedIndicates whether filter lines are displayed.
defaultWidthColumn"max-width: 600px;min-width:100px;width:auto" or string or undefinedDefault width for table columns.
maskQuery"font-bold text-theme-700 dark:text-theme-300" or string or undefinedQuery text mask applied to table content.
borderborder or ITableStylesBorder or "border-0 border-b-0 border-t-0 border-r-0" or undefinedBorder styles for various parts of the table.

Emits

The Table component emits the following events:

EmitPayloadDescription
sort{ dataColumns: Array<IColumnPrivate>; sortedFields: Sorted }Emitted when sorting is applied.
filter{ dataColumns: Array<IColumnPrivate>; filteredFields: Filters }Emitted when filtering is applied.
searchstringEmitted when a search query is applied.
result-dataResultDataEmitted with the result data after processing.
switch-pagenumberEmitted when the page is switched.
switch-size-pagenumberEmitted when the page size is changed.
before-edit-cell{ newValue: any; oldValue: any; _key: string; column: IColumnPrivate }Emitted before editing a cell.
after-edit-cell{ newValue: any; oldValue: any; _key: string; column: IColumnPrivate }Emitted after editing a cell.
before-edit-row{ newValue: any; oldValue: any; _key: string }Emitted before editing a row.
after-edit-row{ newValue: any; oldValue: any; _key: string }Emitted after editing a row.
add-row{ value: any; index: number; _key: string }Emitted when a row is added.
delete-row{ value: any; index: number; _key: string }Emitted when a row is deleted.
click-row{ eventEl: HTMLElement; data: any; indexRow: number }Emitted when a row is clicked.
click-cell{ eventEl: HTMLElement; column: IColumnPrivate; value: any; valueWithMarker: any; data: any; indexRow: number }Emitted when a cell is clicked.
loadingbooleanEmitted when the table enters or exits the loading state.
clear-filtervoidEmitted when all filters are cleared.

Slots

The Table component provides the following slots:

SlotPayloadDescription
toolbarVNode[]Slot for custom toolbar content.
headerVNode[]Slot for custom header content.
group{ item: string; length: number }Slot for custom group content.
defaultDynamicSlotsSlot for rendering dynamic cell templates for each column.
footerVNode[]Slot for custom footer content.

DynamicSlots

The DynamicSlots interface defines the structure for dynamic slots in the Table component. Each slot corresponds to a column or key and provides a custom rendering template for cell content.

PropertyTypeDescription
keystringThe unique identifier for the slot or column.
columnIColumnThe configuration object for the current column.
rowDataRecord<string, any>The data object for the current row.
valuestringThe raw value of the cell.
valueWithMarkerstringThe formatted or marked value of the cell.
isCloseEditor(isActive: boolean) => booleanA function to close the cell editor, requiring a boolean argument to specify the editor state.
editValue(value: any) => false or anyA function to update the cell value. Returns false if the update fails.

Expose

The Table component exposes the following methods and states via ref:

ExposeValueDescription
sortColumnsSortedThe current sorting state for all columns.
filterColumnsFiltersThe current filtering state for all columns.
widthsColumnsWidthsThe current widths for all columns.
queryTableSearchThe current search query.
pageTablePageThe current page number.
sizeTablePageThe current page size.
allDataTableProps["dataSource"]The entire data source of the table.
isLoadingbooleanIndicates whether the table is in a loading state.
modeTableProps["mode"]The current styling mode of the table.
isVisibleToolbarbooleanIndicates whether the toolbar is visible.
isSearchbooleanIndicates whether search functionality is enabled.
isFilterClearbooleanIndicates whether the "clear all filters" button is enabled.
isColumnsbooleanIndicates whether columns are defined.
isSummarybooleanIndicates whether summary rows are defined.
countDataOnLoadingTableProps["countDataOnLoading"]The number of rows to simulate during data loading.
classMaskQueryITableStyles["maskQuery"]The mask applied to query text.
noDataTableProps["noData"]The message displayed when there is no data.
noColumnTableProps["noData"]The message displayed when no columns are defined.
noFilterIFilter["noFilter"]The message displayed when no filters are applied.
iconSortISort["icon"]The icon used for sorting.
resizedColumnsTableProps["resizedColumns"]Indicates whether column resizing is enabled.
lengthDatanumberThe total number of rows in the data source.
groupFieldIGrouping["groupField"] or nullThe field used for grouping data.
isFilterbooleanIndicates whether filtering is enabled.
isSortbooleanIndicates whether sorting is enabled.
isGroupbooleanIndicates whether grouping is enabled.
isPaginationbooleanIndicates whether pagination is enabled.
addRow(data: any) => false or numberAdds a new row to the table.
deleteRow(_key: string) => false or anyDeletes a row from the table.
updateRow(_key: string, data: any) => false or anyUpdates a row in the table.
updateCell(_key: string, column: IColumnPrivate, value: any) => false or anyUpdates a specific cell in the table.
getColumn(dataField: IColumn["dataField"], index?: number) => IColumnPrivate or undefinedRetrieves a column by its data field.
updateDataSource() => Array<Record<string, any>>Updates the data source of the table.
sorting(dataField: IColumn["dataField"], value?: Sort) => voidSorts the table by a specified column.
filtering(dataField: IColumn["dataField"], value: any) => voidFilters the table by a specified column.
searching(value: Search) => voidSearches the table using a query.
switchPage(page: Page) => voidSwitches the table to a specific page.
switchSizePage(sizePage: Page) => voidChanges the page size of the table.
clearFilter() => voidClears all filters applied to the table.
startLoading() => voidStarts the loading state for the table.
stopLoading() => voidStops the loading state for the table.
updateHeightTable() => voidUpdates the height of the table dynamically.
© 2025 FishtVue by Egoka