# SelectionAction

> **Class** in `deepagents_code`

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

Floating "Ask about this" button for the current selection.

It snapshots the selected text because clicking it clears the screen
selection before the `Click` arrives.

## Signature

```python
SelectionAction(
    self,
    text: str,
)
```

## Extends

- `Static`

## Constructors

```python
__init__(
    self,
    text: str,
) -> None
```

| Name | Type |
|------|------|
| `text` | `str` |


## Properties

- `DEFAULT_CSS`
- `selected_text`
- `allow_select`

## Methods

- [`on_mouse_up()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/selection_action/SelectionAction/on_mouse_up)
- [`on_click()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/selection_action/SelectionAction/on_click)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/efa9f5364b83e9367ea57d9c21b15b4d81fdcb7a/libs/code/deepagents_code/tui/widgets/selection_action.py#L82)