Table

A table component.

Examples

Simple Table

A simple table component.

ID
Name
Role
1 John Doe Admin
2 Jane Smith Editor
3 Bob Johnson Viewer

Actions & Pagination

A table with actions and pagination.

Manage Users

User Name
Status
Last Login
Actions
Kamal Singh Active 2 mins ago
Rahul Verma Inactive 2 days ago
Sneha Gupta Active 1 hour ago
Showing 1 - 5 of 100

Full Features (Search + Sort)

A full featured table component.

All Employees

Name
Email Address
Role
Salary ($)
Alice Dev 90000
Bob Design 85000
Charlie Manager 120000
David Dev 95000
Showing 1 - 4 of 4
Last Sort Event: null

Installation

npx wdc add data-table

API Reference

InputTypeDefaultDescription
dataany[]requiredArray of data objects to display in the table rows.
columnsTableColumn[]requiredConfiguration array defining column keys, labels, widths, and sortability.
titlestring''Optional title displayed above the table.
loadingbooleanfalseShows a loading overlay/spinner on top of the table data.
searchablebooleanfalseEnables the search input field in the top toolbar.
withPaginationbooleanfalseEnables the pagination footer, including page numbers and limit selector.
totalItemsnumber0Total count of records (server-side) required for pagination logic.
limitnumber10Number of rows to display per page.
currentPagenumber1The current active page number.
pageSizesnumber[][5, 10, 20, 50, 100]Array of options available in the "Rows per page" dropdown.
pageChangeEvent<number>-Emits the new page number when pagination buttons are clicked.
limitChangeEvent<number>-Emits the new limit when "Rows per page" is changed.
searchChangeEvent<string>-Emits the search query string on input change.
sortChangeEvent<SortEvent>-Emits column key and direction when a header is clicked.
wdcCellDirective-Structural directive to provide custom templates for specific columns (e.g. *wdcCell="status").