Skip to content

@line/bot-sdkDocs


@line/bot-sdk / TemplateCarousel

Type Alias: TemplateCarousel

TemplateCarousel: object

Template with multiple columns which can be cycled like a carousel. The columns will be shown in order by scrolling horizontally.

Because of the height limitation for carousel 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.

Keep the number of actions consistent for all columns. If you use an image or title for a column, make sure to do the same for all other columns.

Type declaration

columns

columns: TemplateColumn[]

Array of columns (Max: 10)

imageAspectRatio?

optional imageAspectRatio: "rectangle" | "square"

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

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

Applies to all columns. The default value is rectangle.

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.

Applies to all columns. The default value is cover.

type

type: "carousel"

Defined in

lib/types.ts:1965