# Dashboard Modes

Canonical page: https://www.adaptabletools.com/docs/ui-dashboard-modes

- By default the Dashboard is visible and placed above AG Grid with Tabs expanded
- However there are alternative Dashboard Modes available to suit different requirements:
  - Collapsed
  - Floating
  - Hidden

The default visibility settings for the Dashboard are:

- Visible
- Placed above AG Grid
- Tabs display Toolbar contents horizontally
- The first Tab is expanded 

However there are 3 alternative options for displaying the Dashboard:

## Collapsed Mode

In Collapsed Mode, AdapTable displays only the Dashboard Header, Title, Buttons and Quick Search.

The Toolbars are not visible and only appear when the name of the Tab is clicked

**Example: Dashboard; Collapsed Mode**

Showing Dashboard in Collapsed Mode

 

- Here the Dashboard is Collapsed - so that only the names of the Tabs are visible at start-up
- We have also set 2 other [Dashboard Options](https://www.adaptabletools.com/docs/technical-reference-dashboard/index.md) properties:
  - `showQuickSearchInHeader` is *false* which removes the Quick Search input
  - `canFloat` is false which means that double-clicking the Dashboard does not put it in floating mode

### Expand to see the Dashboard Options and Initial State

```ts
dashboardOptions: {
  showQuickSearchInHeader: false,
  canFloat: false,
},
initialState: {
  Dashboard: {
    IsCollapsed: true,
    Tabs: [
      {
        Name: 'Search',
        Toolbars: ['GridFilter', 'DataSet', 'QuickSearch'],
      },
      {
        Name: 'Edit',
        Toolbars: ['SmartEdit', 'BulkUpdate', 'DataChangeHistory'],
      },
      {
        Name: 'Notifications',
        Toolbars: ['Alert', 'SystemStatus'],
      },
    ],
  },
},
```

- Click a Tab Header to expand the Dashboard and then click the open Tab to collapse it again

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {AdaptableOptions} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Dashboard Collapsed',
  dashboardOptions: {
    showQuickSearchInHeader: false,
    canFloat: false,
  },
  initialState: {
    Dashboard: {
      IsCollapsed: true,
      Tabs: [
        {
          Name: 'Search',
          Toolbars: ['GridFilter', 'DataSet', 'QuickSearch'],
        },
        {
          Name: 'Edit',
          Toolbars: ['SmartEdit', 'BulkUpdate', 'DataChangeHistory'],
        },
        {
          Name: 'Notifications',
          Toolbars: ['Alert', 'SystemStatus'],
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'has_projects',
            'has_pages',
            'created_at',
            'has_wiki',
            'updated_at',
            'pushed_at',
            'github_watchers',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
  },
};
```

## Floating Mode

Floating Mode render a much narrower Dashboard Header with just the Title displayed.

This control displays **on top** of AG Grid cells

For this reason, Floating Mode can be very useful space saving feature

The floating Dashboard can be dragged to any position by clicking on the Name.

When it does this, the mouse will change to a cross indicating it can be dragged.

Double-clicking the Dashboard (when in floating mode) will restore it to the default **docked** mode.

The `canFloat` property of [Dashboard Options](https://www.adaptabletools.com/docs/technical-reference-dashboard/index.md) can be set to *false* to prevent Floating.

### `canFloat`

Whether the Dashboard can be floated

The Dashboard offers a **floating** mode.

In this scenario, the Dashboard shrinks to display just the Title, and it can be dragged around the screen.

The property defaults to `true` so change it to `false` if you dont want the Dashboard to be floated.

```ts {4}
// Don't allow the Dashboard to be floated
const adaptableOptions: AdaptableOptions = {
    dashboardOptions: {
      canFloat: false
    }
} 
```

**Example: Dashboard: Floating Mode**

Showing Dashboard in Floating Mode

 

- This demo shows the Dashboard in Floating Mode

- Double-click the Title in the Dashboard to dock it, and then double-click again to put it back into floating mode

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {AdaptableOptions} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Dashboard Floating',
  initialState: {
    Dashboard: {
      IsFloating: true,
      Tabs: [
        {
          Name: 'Search',
          Toolbars: ['GridFilter', 'DataSet', 'QuickSearch'],
        },
        {
          Name: 'Edit',
          Toolbars: ['SmartEdit', 'BulkUpdate', 'DataChangeHistory'],
        },
        {
          Name: 'Notifications',
          Toolbars: ['Alert', 'SystemStatus'],
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          Name: 'Standard Layout',
          TableColumns: [
            'name',
            'github_stars',
            'language',
            'week_issue_change',
            'description',
            'created_at',
            'has_wiki',
            'pushed_at',
            'open_issues_count',
          ],
          AutoSizeColumns: true,
        },
      ],
    },
  },
};
```

## Hidden Mode

The Dashboard can be set to be hidden so it is not visible to users.

- The Dashboard is, however, still instantiated by AdapTable
- It can, therefore, be made visible by users via the Column Menu, Context Menu, Tool Panel or Settings Panel

To ensure the Dashboard can **never** be visible set its [Entitlement](https://www.adaptabletools.com/docs/handbook-permissioning/index.md) to `Hidden`

**Example: Dashboard: Hiding**

Hiding the Dashboard altogether

 

- In this demo the Dashboard is set to Hidden and cannot be seen
- However it is initilaised - which means it can be made visible through using the Menus the Tool Panel

- Make the Dashboard visible again by selecting Dashboard / Show from the Column or Context menus

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {AdaptableOptions} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Dashboard Hidden',
  initialState: {
    Dashboard: {
      IsHidden: true,
      Tabs: [
        {
          Name: 'Search',
          Toolbars: ['GridFilter', 'DataSet', 'QuickSearch'],
        },
        {
          Name: 'Edit',
          Toolbars: ['SmartEdit', 'BulkUpdate', 'DataChangeHistory'],
        },
        {
          Name: 'Notifications',
          Toolbars: ['Alert', 'SystemStatus'],
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'has_projects',
            'has_pages',
            'created_at',
            'has_wiki',
            'updated_at',
            'pushed_at',
            'github_watchers',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
  },
};
```

## Switching Dashboard Modes

Run-time users are able to switch easily between the different Dashboard Modes.

This can be done in multiple ways, including:

- Manually in the UI, where users can:

  - Switch between Tabs by clicking the name of a non-active tab

  - Collapse / Expand the Dashboard by clicking on the active tab

  - Float / Dock the Dashboard by double-clicking the Title in the Dashboard Header

- A `Dashboard` Menu Item in both [Column Menu](https://www.adaptabletools.com/docs/ui-column-menu/index.md) and [Context Menu](https://www.adaptabletools.com/docs/ui-context-menu/index.md) containing 4 sub menu items:
  - `Configure` - opens the Dashboard section of the Settings Panel
  - `Collapse` / `Expand`
  - `Float` / `Dock`
  - `Hide` / `Show`

- In the Dashboard [Tool Panel](https://www.adaptabletools.com/docs/ui-tool-panel/index.md) which contains 3 checkboxes:
  - Collapse
  - Float
  - Hidden

These 3 checkboxes are also available in the Dashboard section of the [Settings Panel](https://www.adaptabletools.com/docs/ui-settings-panel/index.md)

## Configuring Dashboard Modes

Each Dashboard Mode can be configured at design-time using [Dashboard Initial State](https://www.adaptabletools.com/docs/technical-reference-dashboard/index.md):

- Collapsed / Expanded View - set via `IsCollapsed` property 

- Floating / Dock View - set via `IsFloating` property 

The Dashboard can only be floated if `canFloat` property is set to *true* in Dashboard Options

- Hidden / Visible - set via `IsHidden` property

Users cannot subsequently make the Dashboard visible if the Dashboard Module entitlement is *Hidden*. See [Permissioning](https://www.adaptabletools.com/docs/handbook-permissioning/index.md).
