Skip to content

@line/bot-sdkDocs


@line/bot-sdk / FlexImage

Type Alias: FlexImage

FlexImage: object & Offset

This component draws an image.

Type declaration

action?

optional action: Action

Action performed when this button is tapped. Specify an action object.

align?

optional align: "start" | "end" | "center"

Horizontal alignment style. Specify one of the following values:

  • start: Left-aligned
  • end: Right-aligned
  • center: Center-aligned

The default value is center.

animated?

optional animated: Boolean

When this is true, an animated image (APNG) plays. You can specify a value of true up to three times in a single message. You can't send messages that exceed this limit. This is false by default. Animated images larger than 300 KB aren't played back.

aspectMode?

optional aspectMode: "cover" | "fit"

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

  • cover: The image fills the entire drawing area. Parts of the image that do not fit in the drawing area are not displayed.
  • fit: The entire image is displayed in the drawing area. The 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 fit.

aspectRatio?

optional aspectRatio: string

Aspect ratio of the image. {width}:{height} format. Specify the value of {width} and {height} in the range from 1 to 100000. However, you cannot set {height} to a value that is more than three times the value of {width}. The default value is 1:1.

backgroundColor?

optional backgroundColor: string

Background color of the image. Use a hexadecimal color code.

flex?

optional flex: number

The ratio of the width or height of this box within the parent box.

The default value for the horizontal parent box is 1, and the default value for the vertical parent box is 0.

gravity?

optional gravity: "top" | "bottom" | "center"

Vertical alignment style. Specify one of the following values:

  • top: Top-aligned
  • bottom: Bottom-aligned
  • center: Center-aligned

The default value is top.

If the layout property of the parent box is baseline, the gravity property will be ignored.

margin?

optional margin: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"

Minimum space between this box and the previous component in the parent box.

  • none does not set a space while the other values set a space whose size increases in the order of listing.
  • The default value is the value of the spacing property of the parent box.
  • If this box is the first component in the parent box, the margin property will be ignored.

size?

optional size: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl" | "full"

Maximum size of the image width. The size increases in the order of listing. The default value is md. For more information, see Image size in the Messaging API documentation.

type

type: "image"

url

url: string

Image URL (Max character limit: 2000)

  • Protocol: HTTPS
  • Image format: JPEG or PNG
  • Maximum image size: 1024×1024 pixels
  • Maximum data size: 1 MB

Defined in

lib/types.ts:1466