Skip to content

co-data-table

This content is not available in your language yet.

Ver código
<co-data-table></co-data-table>

Props

PropAtributoTipoDefaultDescripción
columnscolumnsCoDataTableColumn[] | string'[]'Column definitions (JSON string or array)
emptyActionIconempty-action-iconstring | undefinedOptional left icon (Phosphor name) for the prop-driven empty-action button.
emptyActionLabelempty-action-labelstring | undefinedEmpty-state action button, rendered BY the component (not via slot). Prefer this over the `empty-action` slot: a non-shadow component relocates slotted light-DOM nodes, so projecting togglable framework content (e.g. a Vue `v-if` button) corrupts that framework's virtual DOM. Leave empty to fall back to the `empty-action` slot.
emptyActionVariantempty-action-variant"danger" | "ghost" | "primary" | "secondary" | "stroke" | "success"'stroke'Variant for the prop-driven empty-action button.
emptyIconempty-iconstring'magnifying-glass'Empty state icon (Phosphor icon name).
emptyMessageempty-messagestring'No records found'Empty state secondary message (description).
emptyTitleempty-titlestring''Empty state title (bold heading). Optional — falls back to just the message.
filteredFieldsfiltered-fieldsstring | string[]'[]'Fields with an active column filter (funnel filled + always visible). JSON string or array.
indirectFilteredFieldsindirect-filtered-fieldsstring | string[]'[]'Fields filtered by OTHER filter layers (funnel dimmed hint). JSON string or array.
loadingloadingbooleanfalseShow loading skeleton
resizableresizablebooleantrueEnable column resizing
rowKeyrow-keystring'_id'Field used as unique row identifier
rowsrowsany[] | string'[]'Row data (JSON string or array)
selectableselectablebooleanfalseEnable row selection with checkboxes
selectedKeysselected-keysstring | string[]'[]'Keys of currently selected rows (JSON string or array)
skeletonRowsskeleton-rowsnumber10Number of skeleton rows to display
sortFieldsort-fieldstring''Current sort field
sortOrdersort-order"" | "asc" | "desc"''Current sort direction

Eventos

EventoDetailBubblesCancelableDescripción
coColumnPin{ field: string; }Emitted when a column pin (sticky) is requested
coColumnResize{ field: string; width: number; }Emitted when a column is resized
coEmptyActionvoidFired when the prop-driven empty-action button (`emptyActionLabel`) is clicked.
coHeaderFilter{ field: string; rect: { top: number; left: number; bottom: number; right: number; width: number; height: number; }; }Emitted when a column's filter icon is clicked (rect = icon bounding box for anchoring).
coRowClick{ row: any; index: number; }Emitted when a row is clicked
coRowDblClick{ row: any; index: number; }Emitted when a row is double-clicked
coRowSelect{ key: string; selected: boolean; }Emitted when a row is selected/deselected
coSelectAll{ selected: boolean; }Emitted when select-all checkbox toggles
coSort{ field: string; order: "" | "desc" | "asc"; }Emitted when a column sort is requested

Slots

SlotDescripción
(default)Default slot for custom row content (advanced usage)

CSS Parts

PartDescripción
::part(empty)

CSS Custom Properties

Este componente no expone CSS custom properties.