# ThemeSelectorScreen

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen)

Modal dialog for theme selection with live preview.

Displays available themes in an `OptionList`. Navigating the option list
applies a live preview by swapping the app theme. Returns the selected
theme name on Enter, or `None` on Esc. Esc normally restores the original
theme, but if a per-terminal default was saved with `t` this session, Esc
keeps that theme active instead of reverting.

## Signature

```python
ThemeSelectorScreen(
    self,
    current_theme: str,
    terminal_default: str | None = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `current_theme` | `str` | Yes | The currently active theme name (to highlight). |
| `terminal_default` | `str \| None` | No | The theme saved in `[ui.terminal_themes]` for the current `TERM_PROGRAM`, if any. Badged with `(default)` in the option list. (default: `None`) |

## Extends

- `ModalScreen[str | None]`

## Constructors

```python
__init__(
    self,
    current_theme: str,
    terminal_default: str | None = None,
) -> None
```

| Name | Type |
|------|------|
| `current_theme` | `str` |
| `terminal_default` | `str \| None` |


## Properties

- `BINDINGS`
- `CSS`

## Methods

- [`compose()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/compose)
- [`on_mount()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/on_mount)
- [`on_option_list_option_highlighted()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/on_option_list_option_highlighted)
- [`on_option_list_option_selected()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/on_option_list_option_selected)
- [`action_cancel()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/action_cancel)
- [`action_cursor_down()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/action_cursor_down)
- [`action_cursor_up()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/action_cursor_up)
- [`action_set_for_terminal()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/action_set_for_terminal)
- [`action_toggle_names()`](https://reference.langchain.com/python/deepagents-code/widgets/theme_selector/ThemeSelectorScreen/action_toggle_names)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0412009c5441bef8d75a427e1da8909e33ab5b56/libs/code/deepagents_code/widgets/theme_selector.py#L33)