Button widget

The button widget enables users to make a selection and send a response back to the agent.

Example

Properties

Property

Description

Default value

Data type

actionType

Button action when user clicks, which is one of: cancel | reset | submit.

submit

enum

align

Position of the inline style button relative to the parent container, which is one of: left | right | center.

center

enum

context

See Context properties.

 

string (JSON)

event

Name of event that fires when a user clicks the button, in the format: "event": { "name": "onlogin" }.

 

string (JSON)

id

Unique identifier of this widget.

 

string

setFocus

Indicates whether the engine sets focus to this widget. Default is false.

If set to true, the engine sets focus to the first button when the rich-media widget is presented to the user. This is useful for accessibility and usability, when the user is presented with multiple buttons and must click one.

false

Boolean

size

Button size, which is either: small | large .

small

enum

style

Button style, which is one of: block | inline | outline | outline-block:

  • block: Button occupies the entire width. For example, if an item has multiple buttons, then each button occupies the entire width of the row, and the buttons are not displayed side by side.

  • inline Button occupies the minimum required width. Multiple buttons are displayed side by side, if space permits.

  • outline Button occupies the minimum required width. Multiple buttons are displayed side by side, if space permits. Button is displayed as a border only with blank fill.

  • outline-block: Button occupies the entire width. Button is displayed as a border only with blank fill.For example, if an item has multiple buttons, then each button occupies the entire width of the row, and the buttons are not displayed side by side.

outline- block

enum

text

Text displayed on the button.

 

string

type Rich-media type, which is always Button. string  

Context properties

Context property

Description

Data type

border

Button border color as a hex color code.

string (hex color code)

borderRadius

Button border radius.

number

borderWidth

Button border width.

number

color

Accepts either:

  • one of the following values: primary|secondary|success|danger|warning| info|light|dark|link

  • a JSON string, where primary and secondary colors are specified with the color context property as a hex color code

either enum or string (JSON with hex color code)

textColor

Text color as a hex color code.

string (hex color code)

Samples

Contextual buttons

Outline contextual buttons

Buttons with adjusting button size

Block buttons

Two inline buttons side by side

Two sample block buttons