Skip to main content
Live Demo

Instalation

Basic Usage

SortingField Type

Features

  • One-click add: Click a field to add it with default “asc” direction
  • Drag-and-drop reordering: Change sort priority by dragging items
  • Toggle direction: Click the direction button to switch between ascending/descending
  • Remove sorts: Individual remove buttons for each sort
  • Clear all: One button to clear all sorting
  • Duplicate prevention: Automatically prevents duplicate fields

Drag-and-Drop Sorting

The Sorting component uses @dnd-kit for smooth drag-and-drop interactions:

Multi-level Sorting

The order of sorts matters - the first sort is applied first, then the second, and so on:

With Data Table

Combine Sorting with data tables for a complete solution:

Complete Example

A full example combining useCriteria, Filter, and a data table:

API Reference

useCriteria Options

Filter Props