useWidget Function

Hook that returns information about the Widget in the current context.

useWidget(): { setState: (widgetState: Omit<WidgetState, Floating>) => void, state: WidgetState, widgetLocation: "popout" | "docked" | "floating" }

@note This hook must be used within a widget.

@returns object that contains the WidgetLocation, WidgetState, and the ability to set the state of the widget.

Returns - { setState: (widgetState: Omit<WidgetState, Floating>) => void, state: WidgetState, widgetLocation: "popout" | "docked" | "floating" }

object that contains the WidgetLocation, WidgetState, and the ability to set the state of the widget.

Defined in

Last Updated: 10 June, 2025