GUI Handles

class viser.GuiButtonGroupHandle[source]

Handle for a button group input in our visualizer.

value: str

Value of the input. Represents the currently selected button in the group.

on_click(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine][source]

Attach a function to call when a button in the group is clicked.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

property disabled: bool

Button groups cannot be disabled.

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

options: Tuple[str, ...]

Tuple of buttons for the button group.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

class viser.GuiButtonHandle[source]

Handle for a button input in our visualizer.

value: bool

Value of the button. Set to True when the button is pressed. Can be manually set back to False.

property icon: IconName | None

Icon to display on the button. When set to None, no icon is displayed.

on_click(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine][source]

Attach a function to call when a button is pressed.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

on_hold(func: None = None, callback_hz: float = 10.0) Callable[[_HoldCallback], _HoldCallback][source]
on_hold(func: _HoldCallback, callback_hz: float = 10.0) _HoldCallback

Attach a function to call repeatedly while a button is held down.

The callback will be triggered immediately when the button is pressed, and then repeatedly at the specified frequency until released.

Can be used as a decorator with or without arguments:

@button.on_hold def callback(event): …

@button.on_hold(callback_hz=30.0) def callback(event): …

Or called directly:

button.on_hold(callback) button.on_hold(callback, callback_hz=30.0)

Parameters:
  • func – The callback function to attach. If None, returns a decorator.

  • callback_hz – The frequency in Hz at which to call the callback while the button is held. Defaults to 10.0 Hz.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

color: LiteralColor | Tuple[int, int, int] | None

Color of the button.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

class viser.GuiCheckboxHandle[source]

Handle for checkbox inputs.

value: bool

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

class viser.GuiDropdownHandle[source]

Handle for a dropdown-style GUI input in our visualizer.

value: StringType

Value of the input. Represents the currently selected option in the dropdown.

property options: tuple[StringType, ...]

Options for our dropdown. Synchronized automatically when assigned.

For projects that care about typing: the static type of options should be consistent with the StringType associated with a handle. Literal types will be inferred where possible when handles are instantiated; for the most flexibility, we can declare handles as GuiDropdownHandle[str].

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

class viser.GuiFolderHandle[source]

Use as a context to place GUI elements into a folder.

remove() None[source]

Permanently remove this folder and all contained GUI elements from the visualizer.

Return type:

None

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI folder.

visible: bool

Visibility state of the GUI folder.

expand_by_default: bool

Whether the folder should be expanded by default.

class viser.GuiHtmlHandle[source]

Handling for updating and removing HTML elements.

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

order: float

Order value for arranging GUI elements.

content: str

HTML content to be displayed.

visible: bool

Visibility state of the markdown element.

class viser.GuiImageHandle[source]

Handle for updating and removing images.

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

order: float

Order value for arranging GUI elements.

label: str | None

Label text for the image.

visible: bool

Visibility state of the image.

property image: ndarray

Current content of this image element. Synchronized automatically when assigned.

property format: Literal['auto', 'jpeg', 'png']

Image format. ‘auto’ will use PNG for RGBA images and JPEG for RGB.

class viser.GuiInputHandle[source]

A handle is created for each GUI element that is added in viser. Handles can be used to read and write state.

When a GUI element is added via ViserServer.gui, state is synchronized between all connected clients. When a GUI element is added via ClientHandle.gui, state is local to a specific client.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine][source]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove_update_callback(callback: Literal['all'] | Callable = 'all') None[source]

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

class viser.GuiMarkdownHandle[source]

Handling for updating and removing markdown elements.

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

order: float

Order value for arranging GUI elements.

visible: bool

Visibility state of the markdown element.

property content: str

Current content of this markdown element. Synchronized automatically when assigned.

class viser.GuiMultiSliderHandle[source]

Handle for multi-slider inputs.

value: tuple[IntOrFloat, ...]

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

min: float

Minimum value for the multi-slider.

max: float

Maximum value for the multi-slider.

step: float

Step size for the multi-slider.

min_range: float | None

Minimum allowed range between slider handles.

precision: int

Number of decimal places to display for the multi-slider values.

fixed_endpoints: bool

If True, the first and last handles cannot be moved.

class viser.GuiNumberHandle[source]

Handle for number inputs.

value: IntOrFloat

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

precision: int

Number of decimal places to display for the number value.

step: float

Step size for incrementing/decrementing the number value.

min: float | None

Minimum allowed value for the number input.

max: float | None

Maximum allowed value for the number input.

class viser.GuiPlotlyHandle[source]

Handle for updating and removing Plotly figures.

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

order: float

Order value for arranging GUI elements.

aspect: float

Aspect ratio of the plot.

visible: bool

Visibility state of the plot.

property figure: go.Figure

Current content of this markdown element. Synchronized automatically when assigned.

class viser.GuiRgbHandle[source]

Handle for RGB color inputs.

value: tuple[int, int, int]

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

class viser.GuiRgbaHandle[source]

Handle for RGBA color inputs.

value: tuple[int, int, int, int]

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

class viser.GuiSliderHandle[source]

Handle for slider inputs.

value: IntOrFloat

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

min: float

Minimum value for the slider.

max: float

Maximum value for the slider.

step: float

Step size for the slider.

precision: int

Number of decimal places to display for the slider value.

class viser.GuiTabGroupHandle[source]

Handle for a tab group. Call add_tab() to add a tab.

add_tab(label: str, icon: IconName | None = None) GuiTabHandle[source]

Add a tab. Returns a handle we can use to add GUI elements to it.

Parameters:
  • label (str)

  • icon (IconName | None)

Return type:

GuiTabHandle

remove() None[source]

Remove this tab group and all contained GUI elements.

Return type:

None

order: float

Order value for arranging GUI elements.

visible: bool

Visibility state of the tab group.

class viser.GuiTabHandle[source]

Use as a context to place GUI elements into a tab.

property icon: IconName | None

Icon to display on the tab. When set to None, no icon is displayed.

remove() None[source]

Permanently remove this tab and all contained GUI elements from the visualizer.

Return type:

None

class viser.GuiTextHandle[source]

Handle for text inputs.

value: str

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

multiline: bool
class viser.GuiUploadButtonHandle[source]

Handle for an upload file button in our visualizer.

The .value attribute will be updated with the contents of uploaded files.

value: UploadedFile

Value of the input. Contains information about the uploaded file.

property icon: IconName | None

Icon to display on the upload button. When set to None, no icon is displayed.

on_upload(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine][source]

Attach a function to call when a file is uploaded.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

color: LiteralColor | Tuple[int, int, int] | None

Color of the upload button.

mime_type: str

MIME type of the files that can be uploaded.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

class viser.GuiUplotHandle[source]

Handle for updating and removing Uplot figures.

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

order: float

Order value for arranging GUI elements.

data: Tuple[npt.NDArray[np.float64], ...]

Tuple of 1D numpy arrays containing chart data. First array is x-axis data, subsequent arrays are y-axis data for each series. All arrays must have matching lengths. Minimum 2 arrays required.

mode: Literal[1, 2] | None

1 = aligned (all series share axes), 2 = faceted (each series gets its own subplot panel). Defaults to 1.

Type:

Chart layout mode

title: str | None

Chart title displayed at the top of the plot.

series: Tuple[uplot.Series, ...]

Series configuration objects defining visual appearance (colors, line styles, labels) and behavior for each data array. Must match data tuple length.

bands: Tuple[uplot.Band, ...] | None

High/low range visualizations between adjacent series indices. Useful for confidence intervals, error bounds, or min/max ranges.

scales: Dict[str, uplot.Scale] | None

Scale definitions controlling data-to-pixel mapping and axis ranges. Enables features like auto-ranging, manual bounds, time-based scaling, and logarithmic distributions. Multiple scales support dual-axis charts.

axes: Tuple[uplot.Axis, ...] | None

Axis configuration for positioning (top/right/bottom/left), tick formatting, grid styling, and spacing. Controls visual appearance of chart axes.

legend: uplot.Legend | None

Legend display options including positioning, styling, and custom value formatting for hover states.

cursor: uplot.Cursor | None

Interactive cursor behavior including hover detection, drag-to-zoom, and crosshair appearance. Controls user interaction with the chart.

focus: uplot.Focus | None

Visual highlighting when hovering over series. Controls alpha transparency of non-focused series to emphasize the active one.

aspect: float

Width-to-height ratio for chart display (width/height). 1.0 = square, >1.0 = wider.

visible: bool

Whether the chart is visible in the interface.

class viser.GuiVector2Handle[source]

Handle for 2D vector inputs.

value: tuple[float, float]

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

min: Tuple[float, float] | None

Minimum allowed values for each component of the vector.

max: Tuple[float, float] | None

Maximum allowed values for each component of the vector.

step: float

Step size for incrementing/decrementing each component of the vector.

precision: int

Number of decimal places to display for each component of the vector.

class viser.GuiVector3Handle[source]

Handle for 3D vector inputs.

value: tuple[float, float, float]

Value of the input. Synchronized automatically when assigned.

on_update(func: Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]) Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

Attach a function to call when a GUI input is updated.

Note: - If func is a regular function (defined with def), it will be executed in a thread pool. - If func is an async function (defined with async def), it will be executed in the event loop.

Using async functions can be useful for reducing race conditions.

Parameters:
Return type:

Callable[[GuiEvent[TGuiHandle]], NoneOrCoroutine]

remove() None

Permanently remove this GUI element from the visualizer.

Return type:

None

remove_update_callback(callback: Literal['all'] | Callable = 'all') None

Remove update callbacks from the GUI input.

Parameters:

callback (Literal['all'] | ~typing.Callable) – Either “all” to remove all callbacks, or a specific callback function to remove.

Return type:

None

property update_timestamp: float

Read-only timestamp when this input was last updated.

order: float

Order value for arranging GUI elements.

label: str

Label text for the GUI element.

hint: str | None

Optional hint text for the GUI element.

visible: bool

Visibility state of the GUI element.

disabled: bool

Disabled state of the GUI element.

min: Tuple[float, float, float] | None

Minimum allowed values for each component of the vector.

max: Tuple[float, float, float] | None

Maximum allowed values for each component of the vector.

step: float

Step size for incrementing/decrementing each component of the vector.

precision: int

Number of decimal places to display for each component of the vector.

class viser.UploadedFile[source]

Result of a file upload.

name: str

Name of the file.

content: bytes

Contents of the file.