# onThemeChange

Monitor system theme changes.
**Notice**：Since the refresh mechanism of the Android system theme will cause the entire page to be recreated, it is not possible to monitor system theme changes in real time through this interface on Android devices. To achieve the best adaptation effect, please call the [tt.getSystemInfo](https://open.feishu.cn/document/uAjLw4CM/uYjL24iN/block/api/device/getsysteminfo) interface to process the theme when the block is first loaded.

## Input

Parameter | Data type | Required | Description
---|---|---|---
callback | function | Yes | Callback function when the theme changes

## Output
The callback function returns the properties of the object:

Parameter | Data type | Description
---|---|---
theme | string | Indicates the theme mode of the current system. This field will not be returned until Dark Mode is enabled.<br>- `dark`: the current system is in dark mode<br>- `light`: the current system is in light mode

## Sample code
### Sample request
````js
tt.onThemeChange(({ theme }) => {
  console.log('onThemeChange', theme);
});
````
### Sample response
````json
{
  "theme": "dark"
}
````