class Line::Message::Builder::Flex::Button

Represents a “button” component in a LINE Flex Message.

Buttons are interactive elements that users can tap to trigger an action (e.g., open a URL, send a message, or trigger a postback). They have various styling options, including style (primary, secondary, link) and height.

An action is mandatory for a button component.

Example

Line::Message::Builder.with do
  flex alt_text: "Button Example" do
    bubble do
      body do
        button style: :primary, height: :sm do
          message "Buy Now", label: "Buy" # Action definition
        end
      end
    end
  end
end

See also: