import gradio as gr | |
from gradio_buttontip import ButtonTip | |
def button_click(): | |
return "Button clicked!" | |
with gr.Blocks() as demo: | |
gr.Markdown("This interface showcases a button with a tooltip.") | |
with gr.Row(): | |
inp = ButtonTip( | |
tooltip="Tooltip Text", | |
tooltip_color="white", # Custom color | |
tooltip_background_color="red", | |
x=120, # No horizontal offset | |
y=-20, # Above the button | |
value="Top Button" | |
) | |
out = gr.Textbox() | |
inp.click(button_click, inp, out) | |
if __name__ == "__main__": | |
demo.launch() | |