File size: 940 Bytes
0d0fdc8
 
 
 
 
 
 
 
 
 
c8b1060
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6601d9b
0d0fdc8
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

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="Left Button"
            ),
            ButtonTip(
                tooltip="Tooltip Text",
                tooltip_color="white",  # Custom color
                tooltip_background_color="blue",
                x=-90,  # No horizontal offset
                y=-20,  # Above the button
                value="Right Button"
            )
        ]
        out = "Hello World"

if __name__ == "__main__":
    demo.launch()