ui_element#

class StyledElement(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

A base class for DOM-based UI elements with configurable styling.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

css_classes#

A list of additional CSS classes to add to the underlying DOM element.

css_variables#

Allows to define dynamically computed CSS variables.

This can be used, for example, to coordinate positioning and styling between canvas’ renderers and/or visuals and HTML-based UI elements.

Variables defined here are equivalent to setting the same variables under :host { ... } in a CSS stylesheet.

Note

This property is experimental and may change at any point.

html_attributes#

Allows to configure HTML attributes on the underlying HTML element.

html_id#

Sets the id attribute of the underlying HTML element.

This is a shorthand for the common HTML id attribute. Alternatively the id can be set in the html_attributes dictionary. html_id takes precedence.

styles#

Inline CSS styles applied to the underlying DOM element.

stylesheets#

Additional style-sheets to use for the underlying DOM element.

Note that all bokeh’s components use shadow DOM, thus any included style sheets must reflect that, e.g. use :host CSS pseudo selector to access the root DOM element.

class UIElement(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

Base class for user interface elements.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

context_menu#

A menu to display when user right clicks on the component.

If set to "auto", the component may provide a dynamically generated menu. For example, Plot and related models provide a ToolMenu instance for easy access to their tools.

Note

Use shift key when right clicking to display the native context menu.

visible#

Whether the component should be displayed on screen.