How to use pn.bind with Button?

Can you explain what you see as the problem with your code example?

If you want the clicks as input you could do this:

import panel as pn
pn.extension()

def callback(event):
    return event

button = pn.widgets.Button()
counter = pn.bind(callback, button.param.clicks)
pn.Row(counter, button).servable()
2 Likes