Svelte Reactive Table ALPHA
v0.6.1
GitHub GitHub

Sorting Example

The sorting feature in Svelte Reactive Table provides powerful ways to organize your data. This page demonstrates both single-column and multi-column sorting options.

Basic Sorting

This example shows basic sorting functionality with only one sortable column at a time:

  • Click on column headers to sort in ascending/descending order
  • Only one column can be active for sorting at a time
  • Visual indicators show current sort direction
  • Option to clear sorting and return to default order
Basic Sorting

Click on column headers to sort. Only one column can be sorted at a time.

3Diana Prince5000Themyscira
10Joker40Gotham City
1Bruce Wayne35Gotham City
6Arthur Curry35Atlantis
2Clark Kent33Metropolis
5Hal Jordan32Coast City
8Selina Kyle32Gotham City
4Barry Allen28Central City
9Harley Quinn27Gotham City
7Victor Stone25Jump City

Multi-Column Sorting

This example demonstrates how to enable multi-column sorting, allowing users to sort by multiple criteria simultaneously:

  • Sort by multiple columns with priority given to columns in the order they were selected
  • Hold Shift and click on column headers to add secondary/tertiary sort conditions
  • Each column can be independently toggled between ascending and descending
  • Visual indicators show current sort direction for each column
  • Option to clear all sorting conditions at once
Multi-Column Sorting

Click on column headers to sort. Multiple columns can be sorted simultaneously.

6Arthur Curry35Atlantis
4Barry Allen28Central City
1Bruce Wayne35Gotham City
2Clark Kent33Metropolis
3Diana Prince5000Themyscira
5Hal Jordan32Coast City
9Harley Quinn27Gotham City
10Joker40Gotham City
8Selina Kyle32Gotham City
7Victor Stone25Jump City