# ThemeApi

Canonical page: https://www.adaptabletools.com/docs/reference/themeapi

The theme currently applied, and the system and user themes in state.

```ts title="TypeScript"
export interface ThemeApi 
```

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [applyCurrentTheme()](https://www.adaptabletools.com/docs/reference/themeapi.md#applycurrenttheme) | `void` | Applies the Current Theme. |
| [editTheme(theme)](https://www.adaptabletools.com/docs/reference/themeapi.md#edittheme) | `void` | Replaces a theme already in state. |
| [getCurrentTheme()](https://www.adaptabletools.com/docs/reference/themeapi.md#getcurrenttheme) | `string` | Retrieves name of Current Theme |
| [getCurrentThemeObject()](https://www.adaptabletools.com/docs/reference/themeapi.md#getcurrentthemeobject) | [`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md) | Retrieves the current theme object |
| [getSystemThemes()](https://www.adaptabletools.com/docs/reference/themeapi.md#getsystemthemes) | [`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md)`[]` | Retrieves System Themes in State |
| [getThemeByName(themeName)](https://www.adaptabletools.com/docs/reference/themeapi.md#getthemebyname) | [`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md) | A theme looked up by name, system or user. |
| [getThemes()](https://www.adaptabletools.com/docs/reference/themeapi.md#getthemes) | [`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md)`[]` | Retrieves all Themes (both System &amp; User) in State |
| [getThemeState()](https://www.adaptabletools.com/docs/reference/themeapi.md#getthemestate) | [`ThemeState`](https://www.adaptabletools.com/docs/reference/themestate.md) | Retrieves Theme section from Adaptable State |
| [loadDarkTheme()](https://www.adaptabletools.com/docs/reference/themeapi.md#loaddarktheme) | `void` | Sets AdapTable Dark Theme - updates the AG Grid theme to match |
| [loadLightTheme()](https://www.adaptabletools.com/docs/reference/themeapi.md#loadlighttheme) | `void` | Sets AdapTable Light Theme - updates the AG Grid theme to match |
| [loadTheme(theme)](https://www.adaptabletools.com/docs/reference/themeapi.md#loadtheme) | `void` | Sets Adaptable to use a given theme |
| [openThemeSettingsPanel()](https://www.adaptabletools.com/docs/reference/themeapi.md#openthemesettingspanel) | `void` | Opens Settings Panel with Theme section selected and visible |
| [setSystemThemes(systemThemes)](https://www.adaptabletools.com/docs/reference/themeapi.md#setsystemthemes) | `void` | Sets available System Themes; if empty array is passed none will be |

## Method Details

### applyCurrentTheme

Applies the Current Theme.

```ts title="TypeScript"
applyCurrentTheme(): void;
```

###### Returns

`void`

### editTheme

Replaces a theme already in state.

```ts title="TypeScript"
editTheme(theme: AdaptableTheme): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| theme | [`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md) | Theme to save |

###### Returns

`void`

### getCurrentTheme

Retrieves name of Current Theme

```ts title="TypeScript"
getCurrentTheme(): string;
```

###### Returns

 Name of Current Theme

`string`

### getCurrentThemeObject

Retrieves the current theme object

```ts title="TypeScript"
getCurrentThemeObject(): AdaptableTheme;
```

###### Returns

 The current theme object

[`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md)

### getSystemThemes

Retrieves System Themes in State

```ts title="TypeScript"
getSystemThemes(): AdaptableTheme[];
```

###### Returns

 System Themes in State

[`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md)`[]`

### getThemeByName

A theme looked up by name, system or user.

```ts title="TypeScript"
getThemeByName(themeName: string): AdaptableTheme;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| themeName | `string` | Name of the theme |

###### Returns

 A theme looked up by name, system or user

[`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md)

### getThemes

Retrieves all Themes (both System &amp; User) in State

```ts title="TypeScript"
getThemes(): AdaptableTheme[];
```

###### Returns

 All Themes (both System &amp; User) in State

[`AdaptableTheme`](https://www.adaptabletools.com/docs/reference/adaptabletheme.md)`[]`

### getThemeState

Retrieves Theme section from Adaptable State

```ts title="TypeScript"
getThemeState(): ThemeState;
```

###### Returns

 Theme section from Adaptable State

[`ThemeState`](https://www.adaptabletools.com/docs/reference/themestate.md)

### loadDarkTheme

Sets AdapTable Dark Theme - updates the AG Grid theme to match

```ts title="TypeScript"
loadDarkTheme(): void;
```

###### Returns

`void`

### loadLightTheme

Sets AdapTable Light Theme - updates the AG Grid theme to match

```ts title="TypeScript"
loadLightTheme(): void;
```

###### Returns

`void`

### loadTheme

Sets Adaptable to use a given theme

```ts title="TypeScript"
loadTheme(theme: string): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| theme | `string` | name of theme to apply |

###### Returns

`void`

### openThemeSettingsPanel

Opens Settings Panel with Theme section selected and visible

```ts title="TypeScript"
openThemeSettingsPanel(): void;
```

###### Returns

`void`

### setSystemThemes

Sets available System Themes; if empty array is passed none will be

```ts title="TypeScript"
setSystemThemes(systemThemes: SystemThemeEntry[]): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| systemThemes | [`SystemThemeEntry`](https://www.adaptabletools.com/docs/reference/systemthemeentry.md)`[]` | system themes to use (&#39;light&#39;, &#39;dark&#39;, both, or none) |

###### Returns

`void`
