> ## 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.

# View Manager

> A comprehensive UI for end-users to search, apply, sort, edit, and manage all available table views in one place.

Advanced Tables' View Manager is an easy and convenient way for your end-users to manage all of the views available for the table. Users can quickly search, apply, sort, edit, delete, add to favorites, and more, all from the View Manager. The View Manager can be customized in a variety of ways to match the needs of your application.

## Using the View Manager

The View Manager allows end-users to access, apply, edit, sort, and manage all the available table views, including Preset Views, public views, and global favorites. Depending on which views are enabled, the view manager can display up to five different sections:

1. User favorites (includes: favorited Preset Views, favorited User Views, and global favorite views)
2. User views (non-favorited User Views)
3. Preset views (non-favorited Preset Views)
4. Public views (other user's public views)
5. Global views (global favorites that have been removed from the user's favorites)

### Action button

Next to each view is an action button that gives the user several options depending on the type of view:

1. Apply view
2. Set as default/Remove as default ([NEW!](/v5/features/managed-default-views))
3. Add to favorites/Remove from favorites
4. Edit view (only displayed for the User Views created by the user)
5. Delete view (only displayed for the User Views created by the user)

### Sorting views

User favorites, User views, and Preset views can be sorted by clicking the up/down arrows and then dragging/dropping the view to the desired location. Each view will be confined to it's section.

> Important: If the User Favorites section contains both Preset Views and User Views, Preset Views will always come first, followed by User Views. These two types of views can only be sorted within their respective groupings. In other words, Preset Views can only be sorted among other Preset Views, and User Views can only be sorted among other User Views.

## View Manager configurations

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

### Changing the position in the Favorites Bar

By default, View Manager is displayed at the end of the Favorites Bar. You may position it at the start of the Favorites Bar using the `viewManagerInFavoritesBar()` method:

```php theme={null}
AdvancedTablesPlugin::make()
    ->viewManagerInFavoritesBar(position: 'start')
```

### Displaying in the table toolbar

By default, View Manager is displayed in the Favorites Bar. You may display it in the toolbar by passing `false` to the `viewManagerInFavoritesBar()` method and adding the viewManagerInTable() method:

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

### Changing the position in the table toolbar

By default, View Manager is displayed after the search field. You may display at any of the tooldbar positions available via Filament's toolbar renderhooks by passing the renderhook to the `position` property in the `viewManagerInTable()` method:

```php theme={null}
AdvancedTablesPlugin::make()
    ->viewManagerInTable(position: 'tables::toolbar.toggle-column-trigger.before')
```

### Customizing the trigger action

You can customize the View Manager trigger button using `viewManagerTriggerAction()`, 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;
use Filament\Support\Icons\Heroicon;

AdvancedTablesPlugin::make()
    ->viewManagerTriggerAction(function (Action $action) {
        return $action
            ->button()
            ->label('Views')
            ->icon(Heroicon::OutlinedSquares2x2)
            ->color('primary');
    })
```

### Displaying as a SlideOver

By default, View Manager is displayed as a dropdown. You may display it as a slideOver by adding the `viewManagerSlideOver()` method:

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

#### Dropdown vs slideOver internally

Internally, when displaying View Manager as a slideOver, Advanced Tables only has to query and select from the database the user's *favorite* views as they are the only views show in the table. Since Filament only processes the content in slideOvers when they are triggered by an action button, the remaining views aren't queried until the View Manager is triggered. This helps reduce unnecessary memory usage by selecting a smaller dataset from the database.

However, this also means that when opening a slideOver there is a slight delay as Filament has to then query the database.

On the flip side, when displaying the View Manager as a dropdown, Advanced Tables has to query and select all the available views from the database. This is because dropdowns already load all the data and are simply hidden and shown in Alpine.

This in turn means that there is additional memory usage as all of the table's views are queried from the database and loaded into memory. However, it also means that opening the dropdown is instant as opposed to having a delay with the slideOver.

In most situations, the additional memory usage of the dropdown is worth the tradeoff to have the View Manager instantly available, but knowing how this works internally will help you decide which is best for your application.

### Disabling the View Manager

You may disable the View Manager globally by passing `false` to the `viewManagerEnabled()` method:

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

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

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

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

You may also disable the [Favorites Bar](/v5/features/favorites-bar#disabling-the-favorites-bar) or [Quick Save](/v5/features/quick-save#disabling-quick-save) if needed.

### Hiding the search field

By default the View Manager includes a search field to quickly search for views. You may disable the search field by passing `false` to the `viewManagerSearch()` method:

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

### Displaying a Save View link

You may include a Save View link inside the View Manager with the `viewManagerSaveView()` method:

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

This also allows you to hide the Quick Save button from the Favorites Bar to maximize the space available in the Favorites Bar:

```php theme={null}
AdvancedTablesPlugin::make()
    ->quickSaveInFavoritesBar(false)
    ->viewManagerInFavoritesBar(false)
    ->viewManagerInTable()
    ->viewManagerSaveView()
```

> Note: This option is only available when the View Manager is displayed as a dropdown. When displaying the View Manager as a slideOver, `viewManagerSaveView()` has no effect.

### Displaying a Reset link

You may include a Reset link inside the View Manager that functions the same as clicking the [`Default View` button](/v5/get-started/installation#default-view) with the `viewManagerResetView()` method:

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

This also allows you to [hide Default View button](/v5/features/favorites-bar#disabling-the-default-view) from the Favorites Bar to maximize the space available in the Favorites Bar.

### Disabling Click to Apply

By default a user may click on any of the Views in the View Manager to apply that view's configuration to the table. You may disable this by passing `false` to the `viewManagerClickToApply()` method:

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

### Hiding the Apply button

By default a View's action button includes an `Apply View` button to apply that view's configuration to the table. You may hide this by passing `false` to the `viewManagerApplyButton()` method:

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

### Hiding the Active View Indicator

By default the View Manager will display an indicator next to the currently active view. You may hide this by passing `false` to the `viewManagerActiveViewIndicator()` method:

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

### Displaying the Active View indicator a badge

By default the View Manager will display the active view indicator as a small green dot next to the current active view. You may change this to be a badge with the `viewManagerActiveViewBadge()` method:

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

The name of the badge can be modified in the [language file](/v5/configuration/additional-configurations#language-files).

### Hiding the view type icons

Since different types of views have different available options, by default the View Manager will display view type icons next to each view. If you wish to hide these icons you can pass `false` to the `viewManagerViewTypeIcons()` method:

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

### Displaying view types as badges

If you prefer to display view types as badges instead of icons you can use the `viewManagerViewTypeBadges()` method:

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

### Displaying both public and global view type indicators

By default, when a view is both public and a global favorite, the View Manager will only show the global favorite indicator, be it the icon or the badge. This helps reduce visual clutter as global favorites are already public. However, if you wish to display both you may do so with the `viewManagerPublicIndicatorWhenGlobal()` method:

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

### Hiding the user icon

By default the View Manager will display the chosen icon for User Views and Preset Views in the View Manager. You may hide this icon in the View Manager with the `viewIcon()` method:

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

### Changing the default view icon

If there is no icon associated with the User View or Preset View, a default icon will be shown in the View Manager. You may change which icon is displayed with the `defaultViewIcon()` method:

```php theme={null}
AdvancedTablesPlugin::make()
    ->defaultViewIcon('heroicon-o-queue-list')
```
