button¶
A control that can trigger a function when pressed.
Properties¶
Name | Type | Default | Description |
---|---|---|---|
(★) |
dynamic(str|Icon) | "" | The label displayed in the button. |
on_action |
Callback | The name of a function that is triggered when the button is pressed. The parameters of that function are all optional:
|
|
active |
dynamic(bool) | True | Indicates if this component is active. An inactive component allows no user interaction. |
id |
str | The identifier that will be assigned to the rendered HTML component. |
|
properties |
dict[str, Any] | Bound to a dictionary that contains additional properties for this element. |
|
class_name |
dynamic(str) | List of CSS class names that will be associated with the generated HTML Element.
This class names will be added to the default |
|
hover_text |
dynamic(str) | Information that is displayed when the user hovers over this element. |
(★)label
is the default property for this visual element.
Usage¶
Simple text¶
The button label, which is the button control's default property, is simply displayed as the button text.
Page content
<|Button Label|button|>
<taipy:button>Button Label</taipy:button>
Specific action callback¶
Button can specify a callback function to be invoked when the button is pressed.
Page content
<|Button Label|button|on_action=button_action_function_name|>
<taipy:button on_action="button_action_function_name">Button Label</taipy:button>