Builders for Flex Message containers and components.
Compose a Flex message bottom-up: build components (text/2, image/2,
button/2, separator/1) into box/3es, boxes into a bubble/1
(header/hero/body/footer), bubbles optionally into a carousel/1, then wrap with
flex/2.
alias ExLine.Message.Flex
Flex.flex("alt", Flex.bubble(body: Flex.box(:vertical, [Flex.text("Hello")])))Ref: https://developers.line.biz/en/reference/messaging-api/#flex-message
Summary
Functions
Box component. layout is :horizontal | :vertical | :baseline.
Bubble container. Options: :size, :direction, :header, :hero, :body,
:footer, :action (each block is a box/3, except :hero/:action).
Button component wrapping an action (from ExLine.Message.Action).
Carousel of bubbles.
Flex message wrapping a contents container (a bubble/1 or carousel/1).
Image component. Options: :size, :aspect_ratio, :aspect_mode, :flex.
Separator component. Options: :margin, :color.
Text component. Options: :size, :weight, :color, :align, :wrap, :flex.
Functions
Box component. layout is :horizontal | :vertical | :baseline.
Options: :flex, :spacing, :margin, :padding_all, :background_color.
iex> ExLine.Message.Flex.box(:vertical, [])
%{type: "box", layout: "vertical", contents: []}
Bubble container. Options: :size, :direction, :header, :hero, :body,
:footer, :action (each block is a box/3, except :hero/:action).
Button component wrapping an action (from ExLine.Message.Action).
Options: :style ("primary"/"secondary"/"link"), :color, :flex.
Carousel of bubbles.
Flex message wrapping a contents container (a bubble/1 or carousel/1).
Ref: https://developers.line.biz/en/reference/messaging-api/#flex-message
Image component. Options: :size, :aspect_ratio, :aspect_mode, :flex.
iex> ExLine.Message.Flex.image("https://x/i.jpg")
%{type: "image", url: "https://x/i.jpg"}
Separator component. Options: :margin, :color.
iex> ExLine.Message.Flex.separator()
%{type: "separator"}
Text component. Options: :size, :weight, :color, :align, :wrap, :flex.
iex> ExLine.Message.Flex.text("Hello", weight: "bold")
%{type: "text", text: "Hello", weight: "bold"}