Skip to main content

MouseCursor

Various mouse cursor types that represent different operations or states.

Inherits: enum.Enum

Properties

  • ALIAS - A cursor indicating that the current operation will create an alias of, or a shortcut of the item.
  • ALL_SCROLL - A cursor indicating scrolling in any direction.
  • BASIC - The platform-dependent basic cursor.
  • CELL - A cursor indicating selectable table cells.
  • CLICK - A cursor that emphasizes an element being clickable, such as a hyperlink.
  • CONTEXT_MENU - A cursor indicating somewhere the user can trigger a context menu.
  • COPY - A cursor indicating that the current operation will copy the item.
  • DISAPPEARING - A cursor indicating that the current operation will result in the disappearance of the item.
  • FORBIDDEN - A cursor indicating an operation that will not be carried out.
  • GRAB - A cursor indicating something that can be dragged.
  • GRABBING - A cursor indicating something that is being dragged.
  • HELP - A cursor indicating help information.
  • MOVE - A cursor indicating moving something.
  • NO_DROP - A cursor indicating somewhere that the current item may not be dropped.
  • NONE - Hide the cursor.
  • PRECISE - A cursor indicating precise selection, such as selecting a pixel in a bitmap.
  • PROGRESS - A cursor indicating the status that the program is busy but can still be interacted with.
  • RESIZE_COLUMN - A cursor indicating resizing a column, or an item horizontally.
  • RESIZE_DOWN - A cursor indicating resizing an object from its bottom edge.
  • RESIZE_DOWN_LEFT - A cursor indicating resizing an object from its bottom-left corner.
  • RESIZE_DOWN_RIGHT - A cursor indicating resizing an object from its bottom-right corner.
  • RESIZE_LEFT - A cursor indicating resizing an object from its left edge.
  • RESIZE_LEFT_RIGHT - A cursor indicating resizing an object bidirectionally from its left or right edge.
  • RESIZE_RIGHT - A cursor indicating resizing an object from its right edge.
  • RESIZE_ROW - A cursor indicating resizing a row, or an item vertically.
  • RESIZE_UP - A cursor indicating resizing an object from its top edge.
  • RESIZE_UP_DOWN - A cursor indicating resizing an object bidirectionally from its top or bottom edge.
  • RESIZE_UP_LEFT - A cursor indicating resizing an object from its top-left corner.
  • RESIZE_UP_LEFT_DOWN_RIGHT - A cursor indicating resizing an object bidirectionally from its top left or bottom right corner.
  • RESIZE_UP_RIGHT - A cursor indicating resizing an object from its top-right corner.
  • RESIZE_UP_RIGHT_DOWN_LEFT - A cursor indicating resizing an object bidirectionally from its top right or bottom left corner.
  • TEXT - A cursor indicating selectable text.
  • VERTICAL_TEXT - A cursor indicating selectable vertical text.
  • WAIT - A cursor indicating the status that the program is busy and therefore can not be interacted with.
  • ZOOM_IN - A cursor indicating zooming in.
  • ZOOM_OUT - A cursor indicating zooming out.

Examples

Showcase

import flet as ft


def showcase_card(cursor: ft.MouseCursor) -> ft.GestureDetector:
return ft.GestureDetector(
mouse_cursor=cursor,
content=ft.Container(
width=250,
height=100,
padding=12,
border=ft.Border.all(1, ft.Colors.RED),
border_radius=10,
bgcolor=ft.Colors.SURFACE_CONTAINER_LOW,
content=ft.Column(
spacing=4,
alignment=ft.MainAxisAlignment.CENTER,
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
controls=[
ft.Text(cursor.name, weight=ft.FontWeight.BOLD),
],
),
),
)


def main(page: ft.Page):
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER

page.appbar = ft.AppBar(title="MouseCursor Showcase")
page.add(
ft.SafeArea(
content=ft.Column(
controls=[
ft.Text(
"Hover each card to compare cursor styles. "
"Cursor rendering can vary by OS and browser.",
),
ft.Row(
wrap=True,
spacing=12,
expand=True,
scroll=ft.ScrollMode.AUTO,
alignment=ft.MainAxisAlignment.CENTER,
controls=[showcase_card(cursor) for cursor in ft.MouseCursor],
),
],
),
)
)


if __name__ == "__main__":
ft.run(main)

Properties

ALIASclass-attributeinstance-attribute

A cursor indicating that the current operation will create an alias of, or a shortcut of the item. Typically the shape of an arrow with a shortcut icon at the corner.

ALL_SCROLLclass-attributeinstance-attribute

A cursor indicating scrolling in any direction. Typically the shape of a dot surrounded by 4 arrows.

BASICclass-attributeinstance-attribute

The platform-dependent basic cursor. Typically the shape of an arrow.

CELLclass-attributeinstance-attribute

A cursor indicating selectable table cells. Typically the shape of a hollow plus sign.

CLICKclass-attributeinstance-attribute

A cursor that emphasizes an element being clickable, such as a hyperlink. Typically the shape of a pointing hand.

CONTEXT_MENUclass-attributeinstance-attribute

A cursor indicating somewhere the user can trigger a context menu. Typically the shape of an arrow with a small menu at the corner.

COPYclass-attributeinstance-attribute

A cursor indicating that the current operation will copy the item. Typically the shape of an arrow with a boxed plus sign at the corner.

DISAPPEARINGclass-attributeinstance-attribute

A cursor indicating that the current operation will result in the disappearance of the item. Typically the shape of an arrow with a cloud of smoke at the corner.

FORBIDDENclass-attributeinstance-attribute

A cursor indicating an operation that will not be carried out. Typically the shape of a circle with a diagonal line.

GRABclass-attributeinstance-attribute

A cursor indicating something that can be dragged. Typically the shape of an open hand.

GRABBINGclass-attributeinstance-attribute

A cursor indicating something that is being dragged. Typically the shape of a closed hand.

HELPclass-attributeinstance-attribute

A cursor indicating help information. Typically the shape of a question mark, or an arrow therewith.

MOVEclass-attributeinstance-attribute

A cursor indicating moving something. Typically the shape of four-way arrow.

NO_DROPclass-attributeinstance-attribute

A cursor indicating somewhere that the current item may not be dropped. Typically the shape of a hand with a forbidden sign at the corner.

NONEclass-attributeinstance-attribute

Hide the cursor.

PRECISEclass-attributeinstance-attribute

A cursor indicating precise selection, such as selecting a pixel in a bitmap. Typically the shape of a crosshair.

PROGRESSclass-attributeinstance-attribute

A cursor indicating the status that the program is busy but can still be interacted with. Typically the shape of an arrow with an hourglass or a watch at the corner.

RESIZE_COLUMNclass-attributeinstance-attribute

A cursor indicating resizing a column, or an item horizontally. Typically the shape of arrows pointing left and right with a vertical bar separating them.

RESIZE_DOWNclass-attributeinstance-attribute

A cursor indicating resizing an object from its bottom edge. Typically the shape of an arrow pointing down.

RESIZE_DOWN_LEFTclass-attributeinstance-attribute

A cursor indicating resizing an object from its bottom-left corner. Typically the shape of an arrow pointing lower left.

RESIZE_DOWN_RIGHTclass-attributeinstance-attribute

A cursor indicating resizing an object from its bottom-right corner. Typically the shape of an arrow pointing lower right.

RESIZE_LEFTclass-attributeinstance-attribute

A cursor indicating resizing an object from its left edge. Typically the shape of an arrow pointing left.

RESIZE_LEFT_RIGHTclass-attributeinstance-attribute

A cursor indicating resizing an object bidirectionally from its left or right edge. Typically the shape of a bidirectional arrow pointing left and right.

RESIZE_RIGHTclass-attributeinstance-attribute

A cursor indicating resizing an object from its right edge. Typically the shape of an arrow pointing right.

RESIZE_ROWclass-attributeinstance-attribute

A cursor indicating resizing a row, or an item vertically. Typically the shape of arrows pointing up and down with a horizontal bar separating them.

RESIZE_UPclass-attributeinstance-attribute

A cursor indicating resizing an object from its top edge. Typically the shape of an arrow pointing up.

RESIZE_UP_DOWNclass-attributeinstance-attribute

A cursor indicating resizing an object bidirectionally from its top or bottom edge. Typically the shape of a bidirectional arrow pointing up and down.

RESIZE_UP_LEFTclass-attributeinstance-attribute

A cursor indicating resizing an object from its top-left corner. Typically the shape of an arrow pointing upper left.

RESIZE_UP_LEFT_DOWN_RIGHTclass-attributeinstance-attribute

A cursor indicating resizing an object bidirectionally from its top left or bottom right corner. Typically the shape of a bidirectional arrow pointing upper left and lower right.

RESIZE_UP_RIGHTclass-attributeinstance-attribute

A cursor indicating resizing an object from its top-right corner. Typically the shape of an arrow pointing upper right.

RESIZE_UP_RIGHT_DOWN_LEFTclass-attributeinstance-attribute

A cursor indicating resizing an object bidirectionally from its top right or bottom left corner. Typically the shape of a bidirectional arrow pointing upper right and lower left.

TEXTclass-attributeinstance-attribute

A cursor indicating selectable text. Typically the shape of a capital I.

VERTICAL_TEXTclass-attributeinstance-attribute

A cursor indicating selectable vertical text. Typically the shape of a capital I rotated to be horizontal.

WAITclass-attributeinstance-attribute

A cursor indicating the status that the program is busy and therefore can not be interacted with. Typically the shape of an hourglass or a watch.

This cursor is not available as a system cursor on macOS. Although macOS displays a "spinning ball" cursor when busy, it's handled by the OS and not exposed for applications to choose.

ZOOM_INclass-attributeinstance-attribute

A cursor indicating zooming in. Typically a magnifying glass with a plus sign.

ZOOM_OUTclass-attributeinstance-attribute

A cursor indicating zooming out. Typically a magnifying glass with a minus sign.