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)
| 850 | |
| 851 | |
| 852 | def 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 | |
| 882 | def put_image(src: Union[str, bytes, PILImage], format: str = None, title: str = '', width: str = None, |
no test coverage detected
searching dependent graphs…