ChatiumFor developersPlaygroundPricing
Sign in

Button

Properties

  • onClick ((event: MouseEvent) => void) | AppUiAction | AppUiAction[]:
    Click event handler for the button. It can be a function, an AppUiAction object, or an array of such objects. If it is an object, the click handling stops and the event is passed for action processing through processActions.
  • primary (boolean):
    Applies the primary action style to the button. If true, the button will be styled as primary.
  • warning (boolean):
    Applies a warning style to the button.
  • danger (boolean):
    Applies a danger style to the button, which is often used for delete buttons or critical actions.
  • info (boolean):
    Applies an informational style to the button.
  • success (boolean):
    Applies a success action style to the button.
  • light (boolean):
    Applies a light style to the button.
  • dark (boolean):
    Applies a dark style to the button.
  • link (boolean):
    Applies a link style to the button.
  • waiting (boolean):
    If true, displays a waiting state (e.g., loading indicator) on the button.
  • icon (IconProps['name'] | jsx.JSX.Element):
    An icon that will be displayed to the left of the button text. It can be a string (icon name) or a JSX element.
  • size ('lg' | 'sm'):
    Sets the size of the button: lg for large button and sm for small.
  • disabled (boolean):
    Disables the button, preventing interaction with it.

Events

  • onClick (MouseEvent):
    Click event handler. If an AppUiAction object is provided, the handler calls processActions, which processes actions related to the button. If a function is provided, it is called directly upon clicking.