# EditorUi.setTheme Method

> EditorUi.setTheme method in the TX Sheet Control TypeScript API for Node.js, with the return type "dark" | "auto" | "light" and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > EditorUi > EditorUi.setTheme Method
- **428 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/editorui/settheme-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/editorui/settheme-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/editorui/settheme-method/llms-full.txt

---

The setTheme operation of EditorUi.

Owner: [EditorUi](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/editorui/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

### Syntax

```typescript
setTheme(theme: "auto" | "light" | "dark"): "auto" | "light" | "dark"
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `theme` | `"dark" \| "auto" \| "light"` | No | Value matching theme's declared type and the owning object's validation rules. |

### Return Value

`"dark" | "auto" | "light"`.

### Examples

Pass an existing EditorUi from the owning document. Related handles and input bytes must belong to the intended document and application; the function applies the operation and inspects its result.

```typescript
function applyEditorUiSetTheme(editorUi: { setTheme(argument0: 'auto' | 'light' | 'dark'): unknown }) {
    const result = editorUi['setTheme']('auto');
    console.log(result);
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [EditorUi Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/editorui/llms-full.txt)
- [Formatting and Number Display](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formatting/llms-full.txt)

---

## Nearby

- **Previous:** [EditorUi.setResources Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/editorui/setresources-method/llms-full.txt)
- **Next:** [EditorUi.setViewMode Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/editorui/setviewmode-method/llms-full.txt)
