API referencecomponents
ComponentWidget
Base class for composable component-library anywidgets.
Component families inherit this class to share child composition, keyed access, open/close state, size traits, and activation callbacks.
on_click runs for every activation and on_action runs only for
activations that carry a value, so a menu item choice runs both. To mirror
state between sibling widgets use traitlets.link or observe rather
than callbacks.
Attributes
attributecomponent_family= t.Unicode('').tag(sync=True)attributecomponent_kind= t.Unicode('element').tag(sync=True)attributetag= t.Unicode('').tag(sync=True)attributewidgets= ChildList(anywidget.WidgetTrait(), default_value=[]).tag(sync=True, to_json=_widget_list_to_json, from_json=_widget_list_from_json)attributechild_keys= t.List(t.Unicode(), default_value=[]).tag(sync=True)attributetitles= t.List(t.Unicode(), default_value=[]).tag(sync=True)attributetext= t.Unicode('').tag(sync=True)attributelabel= t.Unicode('').tag(sync=True)attributevalue= t.Any(None, allow_none=True).tag(sync=True)attributeis_open= t.Bool(False).tag(sync=True)attributedisabled= t.Bool(False).tag(sync=True)attributeselected= t.Bool(False).tag(sync=True)attributeindeterminate= t.Bool(False).tag(sync=True)attributevariant= t.Unicode('').tag(sync=True)attributeplacement= t.Unicode('bottom').tag(sync=True)attributeorientation= t.Unicode('horizontal').tag(sync=True)attributewidth= t.Unicode('').tag(sync=True)attributeheight= t.Unicode('').tag(sync=True)attributeicon= t.Unicode('').tag(sync=True)attributeicon_src= t.Unicode('').tag(sync=True)attributeicon_size= t.Unicode('s').tag(sync=True)attributeattributes= t.Dict(default_value={}).tag(sync=True)attributelast_action= t.Any(None, allow_none=True).tag(sync=True)Functions
constructor__init__(children=None, *, titles=None, keys=None, callbacks=None, action_callbacks=None, width=None, height=None, **kwargs) -> NoneparamchildrenChildInput= NoneparamtitlesTitleInput= NoneparamkeysIterable[str] | None= NoneparamcallbacksIterable[Callable[[ComponentWidget], None]] | None= Noneparamaction_callbacksIterable[ActionCallback] | None= Noneparamwidthint | float | str | None= Noneparamheightint | float | str | None= NoneparamkwargsAny= {}Returns
Nonefuncshow() -> NoneOpen overlay-like components.
Returns
Nonefunchide() -> NoneClose overlay-like components.
Returns
Nonefunctoggle() -> NoneToggle overlay-like components.
Returns
None