Table
A set of composable components that work together in the same way as native HTML table elements.
To ensure maximum flexibility and composability, sorting logic is decoupled from the table component. This allows you to implement a sorting strategy tailored to your specific application requirements.
Below are some examples of how you might implement sorting logic in your application, using the vwc-table-sorting-button to trigger sorting actions. These examples are not exhaustive, but they demonstrate how you can use the sorting button in conjunction with your own sorting logic, whether it's a simple vanila js sorting or more complex using headless mechanisms.
Below example performs sorting using native JavaScript array sorting, without any additional libraries. Custom sorting functions are provided for each column, and the current sort state is managed using Vue's reactivity system.
Below example uses the fast-sort library to perform sorting.
This example demonstrates an example of sorting using TanStack Table.