Skip to content

Sort

@xngui/cdk/sort
@xngui/cdk/sort

Headless sort column + direction state.

Preview

Shift+click a column to add it to the sort stack.

Active sort: none

  • Ada LovelaceEngineer
  • Grace HopperLead
  • Alan TuringResearch
  • Katherine JohnsonEngineer
import { XSortState } from '@xngui/cdk/sort';
 
const sort = new XSortState();
 
sort.toggle('name'); // primary column
sort.toggle('role', { additive: true }); // Shift+click / secondary
 
sort.sort(); // → []
sort.clear();

Events

Interact with the preview — events will appear here.