Skip to content

@line/bot-sdkDocs


@line/bot-sdk / TemplateButtons

Type Alias: TemplateButtons

TemplateButtons: object

Template with an image, title, text, and multiple action buttons.

Because of the height limitation for buttons template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

Type declaration

actions

actions: Action[]

Action when tapped (Max: 4)

imageAspectRatio?

optional imageAspectRatio: "rectangle" | "square"

Aspect ratio of the image. Specify one of the following values:

  • rectangle: 1.51:1
  • square: 1:1

The default value is rectangle

imageBackgroundColor?

optional imageBackgroundColor: string

Background color of image. Specify a RGB color value. The default value is #FFFFFF (white).

imageSize?

optional imageSize: "cover" | "contain"

Size of the image. Specify one of the following values:

  • cover: The image fills the entire image area. Parts of the image that do not fit in the area are not displayed.
  • contain: The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images.

The default value is cover.

text

text: string

Message text

  • Max: 160 characters (no image or title)
  • Max: 60 characters (message with an image or title)

thumbnailImageUrl?

optional thumbnailImageUrl: string

Image URL (Max: 2000 characters)

  • HTTPS
  • JPEG or PNG
  • Max width: 1024px
  • Max: 1 MB

title?

optional title: string

Title (Max: 40 characters)

type

type: "buttons"

Defined in

lib/types.ts:1879