panel.chat.icon module#
The icon module provides a low-level API for rendering chat related icons.
- class panel.chat.icon.ChatCopyIcon(*, _request_sync, _synced, fill, value, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, name)[source]#
Bases:
ReactiveHTML
ChatCopyIcon copies the value to the clipboard when clicked. To avoid sending the value to the frontend the value is only synced after the icon is clicked.
Parameter Definitions
Parameters inherited from:
panel.viewable.Layoutable
: align, aspect_ratio, design, height, min_width, min_height, max_width, max_height, margin, styles, stylesheets, tags, width, width_policy, height_policy, sizing_mode, visiblepanel.viewable.Viewable
: loadingcss_classes = List(allow_refs=True, bounds=(0, None), default=['copy-icon'], label='Css classes', nested_refs=True)
The CSS classes of the widget.
fill = String(default='none', label='Fill')
The fill color of the icon.
value = String(allow_None=True, label='Value')
The text to copy to the clipboard.
_synced = String(allow_None=True, label=' synced')
The text to copy to the clipboard.
_request_sync = Integer(default=0, inclusive_bounds=(True, True), label=' request sync')
- class panel.chat.icon.ChatReactionIcons(*, active_icons, default_layout, options, disabled, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, value, name)[source]#
Bases:
CompositeWidget
A widget to display reaction icons that can be clicked on.
- Parameters:
- valueList
The selected reactions.
- optionsDict
A key-value pair of reaction values and their corresponding tabler icon names found on https://tabler-icons.io.
- active_iconsDict
The mapping of reactions to their corresponding active icon names; if not set, the active icon name will default to its “filled” version.
- Reference: https://panel.holoviz.org/reference/chat/ChatReactionIcons.html
- :Example:
- >>> ChatReactionIcons(value=[“like”], options={“like”: “thumb-up”, “dislike”: “thumb-down”})
Parameter Definitions
Parameters inherited from:
panel.viewable.Layoutable
: align, aspect_ratio, design, min_width, min_height, max_width, max_height, styles, stylesheets, tags, width_policy, height_policy, sizing_mode, visiblepanel.viewable.Viewable
: loadingpanel.widgets.base.Widget
: height, width, disabledvalue = List(bounds=(0, None), default=[], label='Value')
The active reactions.
css_classes = List(allow_refs=True, bounds=(0, None), default=['reaction-icons'], label='Css classes', nested_refs=True)
The CSS classes of the widget.
margin = Margin(allow_None=True, allow_refs=True, default=0, label='Margin')
Allows to create additional space around the component. May be specified as a two-tuple of the form (vertical, horizontal) or a four-tuple (top, right, bottom, left).
active_icons = Dict(class_=<class 'dict'>, default={}, label='Active icons')
The mapping of reactions to their corresponding active icon names. If not set, the active icon name will default to its “filled” version.
options = Dict(class_=<class 'dict'>, default={'favorite': 'heart'}, label='Options')
A key-value pair of reaction values and their corresponding tabler icon names found on https://tabler-icons.io.
default_layout = ClassSelector(class_=<class 'panel.layout.base.Panel'>, default=<class 'panel.layout.base.Column'>, label='Default layout')