<jupyter_start><jupyter_text>The ``Button`` widget allows triggering events when the button is clicked. In addition to a value parameter, which will toggle from `False` to `True` while the click event is being processed an additional ``clicks`` parameter that can be watched to subscribe to click events.For more information about listening to widget events and laying out widgets refer to the [widgets user guide](../../user_guide/Widgets.ipynb). Alternatively you can learn how to build GUIs by declaring parameters independently of any specific widgets in the [param user guide](../../user_guide/Param.ipynb). To express interactivity entirely using Javascript without the need for a Python server take a look at the [links user guide](../../user_guide/Param.ipynb). Parameters:For layout and styling related parameters see the [customization user guide](../../user_guide/Customization.ipynb). Core* **``clicks``** (int): Number of clicks (can be listened to)* **``value``** (boolean): Toggles from `False` to `True` while the event is being processed. Display* **``button_type``** (str): A button theme; should be one of ``'default'`` (white), ``'primary'`` (blue), ``'success'`` (green), ``'info'`` (yellow), or ``'danger'`` (red)* **``disabled``** (boolean): Whether the widget is editable* **``name``** (str): The title of the widget___<jupyter_code>button = pn.widgets.Button(name='Click me', button_type='primary')
button<jupyter_output><empty_output><jupyter_text>The ``clicks`` parameter will report the number of times the button has been pressed:<jupyter_code>button.clicks<jupyter_output><empty_output><jupyter_text>The ``on_click`` method can trigger function when button is clicked:<jupyter_code>text = pn.widgets.TextInput(value='Ready')

def b(event):
    text.value = 'Clicked {0} times'.format(button.clicks)
    
button.on_click(b)
pn.Row(button, text)<jupyter_output><empty_output><jupyter_text>The ``Button`` name string may contain Unicode characters, providing a convenient way to define common graphical buttons:<jupyter_code>backward = pn.widgets.Button(name='\u25c0', width=50)
forward = pn.widgets.Button(name='\u25b6', width=50)
search = pn.widgets.Button(name='🔍', width=100)

pn.Row(backward, forward, search)<jupyter_output><empty_output><jupyter_text>The color of the button can be set by selecting one of the available button types:<jupyter_code>pn.Column(*(pn.widgets.Button(name=p, button_type=p) for p in pn.widgets.Button.param.button_type.objects))<jupyter_output><empty_output><jupyter_text>ControlsThe `Button` widget exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively:<jupyter_code>pn.Row(button.controls, button)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12743682310469315, 'fraction_numerical': 0.005054151624548736, 'mean_word_length': 6.5710382513661205, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '37152', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 846, 'n_tokens_neox': 807, 'n_words': 280, 'path': 'examples/reference/widgets/Button.ipynb', 'repo_name': 'mathrick/panel', 'size': '2770'}