API Docs


The Button class adds button widget. It is displayed below the code cell in the Jupyter Notebook and in the sidebar in the Mercury.

import mercury as mr
# add button 
button = mr.Button(label="", style="primary")
# after button clicked this will be true
# but it will be true only once!
if button.clicked:
    print("Button clicked!")
# second read will return false
if button.clicked:
    print("It will not be printed!")


  • label (string) - the label on the button.
  • style (string) - style (color) of the button, default is set to primary, available styles are ["primary", "success", "info", "warning", "danger"].