Constructor

BasicCard

new BasicCard(basicCard)

Constructor for BasicCard. Accepts optional BasicCard to clone.

Parameter

basicCard

Optional

BasicCard

Optional BasicCard to clone.

Properties

buttons

Array of Button

Ordered list of buttons to show below card. Optional.

formattedText

string

Body text to show on the card. Required, unless image is present.

image

Image

Image to show on the card. Optional.

subtitle

string

Subtitle of the card. Optional.

title

string

Title of the card. Optional.

Methods

addButton

addButton(text, url) returns BasicCard

Adds a button below card.

Parameter

text

string

Text to show on button.

url

string

URL to open when button is selected.

Returns

BasicCard Returns current constructed BasicCard.

setBodyText

setBodyText(bodyText) returns BasicCard

Sets the body text for this Basic Card.

Parameter

bodyText

string

Body text to show on card.

Returns

BasicCard Returns current constructed BasicCard.

setImage

setImage(url, accessibilityText, width, height) returns BasicCard

Sets the image for this Basic Card.

Parameter

url

string

Image source URL.

accessibilityText

string

Text to replace for image for accessibility.

width

Optional

number

Width of the image.

height

Optional

number

Height of the image.

Returns

BasicCard Returns current constructed BasicCard.

setImageDisplay

setImageDisplay(option) returns BasicCard

Sets the display options for the image in this Basic Card. Use one of the image display constants. If none is chosen, ImageDisplays.DEFAULT will be enforced.

Parameter

option

string

The option for displaying the image.

Returns

BasicCard Returns current constructed BasicCard.

setSubtitle

setSubtitle(subtitle) returns BasicCard

Sets the subtitle for this Basic Card.

Parameter

subtitle

string

Subtitle to show on card.

Returns

BasicCard Returns current constructed BasicCard.

setTitle

setTitle(title) returns BasicCard

Sets the title for this Basic Card.

Parameter

title

string

Title to show on card.

Returns

BasicCard Returns current constructed BasicCard.