Skip to content

Button

A standalone button component that can be linked to a click event handler.

Streamsync uses the library RemixIcon to display icons. To include an icon, check remixicon.com, find the icon's id (such as arrow-up) and it to your Button.

Fields

NameTypeDescriptionOptions
TextText
DisabledTextDisables all event handlers.
  • Yes
  • No
ButtonColor
Button textColor
IconTextA RemixIcon id, such as "arrow-up".
Button shadowShadow
SeparatorColor
Custom CSS classesTextCSS classes, separated by spaces. You can define classes in custom stylesheets.

Events

NameDescriptionUsage
ss-clickCapture single clicks.
def handle_button_click(state):

  # Increment counter when the button is clicked

  state["counter"] += 1

Low code usage

This component can be declared directly in Python, using backend-driven UI.

python
ui.Button(content={
        "text": "", # str 
        "isDisabled": "no", # str [yes, no]
        "buttonColor": "", # str 
        "buttonTextColor": "", # str 
        "icon": "", # str 
        "buttonShadow": "", # str 
        "separatorColor": "", # str 
        "cssClasses": "", # str 
    },
    handlers={
        "ss-click": handle_event,
    }
)
A function, in this example handle_event, should be implemented in your code to handle events.
python
def handle_event(state, payload, context, ui):
  pass

Reference