Other
Button
A standalone button component that can be linked to a click event handler.
Writer Framework uses Material Symbols to display icons. To include an icon, check https://fonts.google.com/icons, find the icon’s id (such as arrow_forward
) and it to your Button.
Fields
Name | Type | Description | Options |
---|---|---|---|
Text | Text | ||
Disabled | Text | Disables all event handlers. |
|
Button | Color | ||
Button text | Color | ||
Icon | Text | A Material Symbols id, such as “arrow_forward”. | |
Button shadow | Shadow | ||
Separator | Color | ||
Custom CSS classes | Text | CSS classes, separated by spaces. You can define classes in custom stylesheets. |
Events
Low code usage
This component can be declared directly in Python, using backend-driven UI.
ui.Button(content={
"text": "", # str
"isDisabled": "no", # str [yes, no]
"buttonColor": "", # str
"buttonTextColor": "", # str
"icon": "", # str
"buttonShadow": "", # str
"separatorColor": "", # str
"cssClasses": "", # str
},
handlers={
"wf-click": handle_event,
}
)
A function, in this example handle_event
, should be implemented in your code to handle events.
def handle_event(state, payload, context, ui):
pass