MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / put_button

Function put_button

pywebio/output.py:852–879  ·  view source on GitHub ↗

Output a single button and bind click event to it. :param str label: Button label :param callable onclick: Callback which will be called when button is clicked. :param str color: The color of the button, can be one of: `primary`, `secondary`, `success`, `danger`, `warning`, `inf

(label: str, onclick: Callable[[], None], color: str = None, small: bool = None, link_style: bool = False,
               outline: bool = False, disabled: bool = False, scope: str = None,
               position: int = OutputPosition.BOTTOM)

Source from the content-addressed store, hash-verified

850
851
852def put_button(label: str, onclick: Callable[[], None], color: str = None, small: bool = None, link_style: bool = False,
853 outline: bool = False, disabled: bool = False, scope: str = None,
854 position: int = OutputPosition.BOTTOM) -> Output:
855 """Output a single button and bind click event to it.
856
857 :param str label: Button label
858 :param callable onclick: Callback which will be called when button is clicked.
859 :param str color: The color of the button,
860 can be one of: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `light`, `dark`.
861 :param bool disabled: Whether the button is disabled
862 :param - small, link_style, outline, scope, position: Those arguments have the same meaning as for `put_buttons()`
863
864 Example:
865
866 .. exportable-codeblock::
867 :name: put_button
868 :summary: `put_button()` usage
869
870 put_button("click me", onclick=lambda: toast("Clicked"), color='success', outline=True)
871
872 .. versionadded:: 1.4
873
874 .. versionchanged:: 1.5
875 add ``disabled`` parameter
876 """
877 return put_buttons([{'label': label, 'value': '', 'color': color or 'primary', 'disabled': disabled}],
878 onclick=[onclick], small=small, link_style=link_style, outline=outline, scope=scope,
879 position=position)
880
881
882def put_image(src: Union[str, bytes, PILImage], format: str = None, title: str = '', width: str = None,

Callers 6

basic_outputFunction · 0.85
get_openai_configFunction · 0.85
on_key_pressFunction · 0.85
show_popupFunction · 0.85
output_widgetsFunction · 0.85
mainFunction · 0.85

Calls 1

put_buttonsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…