# default_exp custom_input.buttons

Custom ButtonsΒΆ

action_btn = ActionButton()
action_btn
# it can retrieve button value on callback

value = 2
action_btn.value = value

new_value = None


def on_btn_click(event: ActionButton):
    global new_value
    new_value = event.value


action_btn.on_click(on_btn_click)
action_btn.click()

assert new_value == value
# it can accept default value

action_btn = ActionButton(value=value)
assert action_btn.value == value