|
| 1 | +# <pointer> |
| 2 | + |
| 3 | +The `<pointer>` CSS type represents pointer (cursor) shapes that can be displayed when the mouse is over a widget. |
| 4 | + |
| 5 | +## Syntax |
| 6 | + |
| 7 | +The [`<pointer>`](./pointer.md) type can take any of the following values: |
| 8 | + |
| 9 | +| Value | Description | |
| 10 | +|-----------------|--------------------------------------------------| |
| 11 | +| `default` | Default pointer shape. | |
| 12 | +| `pointer` | Pointing hand (typically used for links). | |
| 13 | +| `text` | Text selection cursor (I-beam). | |
| 14 | +| `crosshair` | Crosshair cursor. | |
| 15 | +| `help` | Help cursor (often a question mark). | |
| 16 | +| `wait` | Wait/busy cursor. | |
| 17 | +| `progress` | Progress cursor (indicating background activity).| |
| 18 | +| `move` | Move cursor (four-directional arrows). | |
| 19 | +| `grab` | Open hand (grabbable). | |
| 20 | +| `grabbing` | Closed hand (grabbing). | |
| 21 | +| `cell` | Cell selection cursor. | |
| 22 | +| `vertical-text` | Vertical text selection cursor. | |
| 23 | +| `alias` | Alias/shortcut cursor. | |
| 24 | +| `copy` | Copy cursor. | |
| 25 | +| `no-drop` | No drop allowed cursor. | |
| 26 | +| `not-allowed` | Not allowed/prohibited cursor. | |
| 27 | +| `n-resize` | Resize cursor pointing north. | |
| 28 | +| `s-resize` | Resize cursor pointing south. | |
| 29 | +| `e-resize` | Resize cursor pointing east. | |
| 30 | +| `w-resize` | Resize cursor pointing west. | |
| 31 | +| `ne-resize` | Resize cursor pointing northeast. | |
| 32 | +| `nw-resize` | Resize cursor pointing northwest. | |
| 33 | +| `se-resize` | Resize cursor pointing southeast. | |
| 34 | +| `sw-resize` | Resize cursor pointing southwest. | |
| 35 | +| `ew-resize` | Resize cursor for horizontal resizing. | |
| 36 | +| `ns-resize` | Resize cursor for vertical resizing. | |
| 37 | +| `nesw-resize` | Resize cursor for diagonal (NE-SW) resizing. | |
| 38 | +| `nwse-resize` | Resize cursor for diagonal (NW-SE) resizing. | |
| 39 | +| `zoom-in` | Zoom in cursor (magnifying glass with +). | |
| 40 | +| `zoom-out` | Zoom out cursor (magnifying glass with -). | |
| 41 | + |
| 42 | +!!! note |
| 43 | + The `pointer` style requires terminal support for the Kitty pointer shapes protocol. Not all terminals support this feature. |
| 44 | + |
| 45 | +## Examples |
| 46 | + |
| 47 | +### CSS |
| 48 | + |
| 49 | +```css |
| 50 | +#my-button { |
| 51 | + pointer: pointer; /* Show a pointing hand cursor */ |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +### Python |
| 56 | + |
| 57 | +```py |
| 58 | +widget.styles.pointer = "pointer" # Show a pointing hand cursor |
| 59 | +``` |
0 commit comments