Skip to content

@line/bot-sdk


@line/bot-sdk / TemplateButtons

Type Alias: TemplateButtons

TemplateButtons = object

Defined in: lib/types.ts:1879

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.

Properties

actions

actions: Action[]

Defined in: lib/types.ts:1930

Action when tapped (Max: 4)


imageAspectRatio?

optional imageAspectRatio: "rectangle" | "square"

Defined in: lib/types.ts:1898

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

Defined in: lib/types.ts:1915

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


imageSize?

optional imageSize: "cover" | "contain"

Defined in: lib/types.ts:1910

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

Defined in: lib/types.ts:1926

Message text

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

thumbnailImageUrl?

optional thumbnailImageUrl: string

Defined in: lib/types.ts:1889

Image URL (Max: 2000 characters)

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

title?

optional title: string

Defined in: lib/types.ts:1919

Title (Max: 40 characters)


type

type: "buttons"

Defined in: lib/types.ts:1880