> ## Documentation Index
> Fetch the complete documentation index at: https://docs.advancedtables.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Sort

> Enable users to sort tables by multiple columns with drag-and-drop reordering, fully integrated with Preset and User Views.

![Multi-Sort](https://advancedtables.com/images/multi-sort.png)

Advanced Tables now allows your users to sort their tables by multiple columns. Using the new Multi-Sort dropdown, users can add additional columns to sort by, easily change sort direction, and even reorder the columns. And Multi-Sort is completely integrated with [Preset Views](/v5/features/preset-views) and [User Views](/v5/features/user-views).

> Note: The multi-sort button will only be displayed when there is at least one sortable column.

## Using with Preset Views

You can apply multi-sorting in your [Preset Views](/v5/features/preset-views) through the `defaultSort()` method:

```php theme={null}
'processing' => PresetView::make()
    ->defaultSort([
        'is_visible' => 'desc',
        'price' => 'asc'
    ])
```

## Multi-Sort configurations

Advanced Tables offers multiple ways to customize Multi-Sort. Unless specified otherwise, these options can be configured directly on the `AdvancedTablesPlugin` object inside your `PanelProvider`.

### Disabling Multi-Sort

Advanced Tables enables multi-sorting by default. You may disable this globally by passing false to the `multiSortEnabled()` method:

```php theme={null}
AdvancedTablesPlugin::make()
    ->multiSortEnabled(false)
```

You may also configure this per table by overriding the `multiSortIsEnabled()` method on your List page:

```php theme={null}
class ListOrders extends ListRecords
{
    use AdvancedTables; 

    public static function multiSortIsEnabled(): bool
    {
        return false;
    }
    ...
```

### Customizing the trigger action

You can customize the Multi-Sort trigger button using `multiSortTriggerAction()`, following the same pattern as Filament's [trigger action customization](https://filamentphp.com/docs/5.x/tables/filters/overview#customizing-the-filters-trigger-action):

```php theme={null}
use Filament\Actions\Action;

AdvancedTablesPlugin::make()
    ->multiSortTriggerAction(function (Action $action) {
        return $action
            ->icon('heroicon-s-chevron-up-down')
            ->tooltip('Sort by multiple columns')
            ->color('primary');
    })
```

### Customizing the buttons and labels

You may customize Multi-Sort buttons, labels in the language file.
