(::String) — The alternative text that's used for accessibility.
Set descriptive text that lets users know what the button does. For
example, if a button opens a hyperlink, you might write: "Opens a new
browser tab and navigates to the Google Chat developer documentation at
https://developers.google.com/workspace/chat".
#alt_text=
defalt_text=(value)->::String
Parameter
value(::String) — The alternative text that's used for accessibility.
Set descriptive text that lets users know what the button does. For
example, if a button opens a hyperlink, you might write: "Opens a new
browser tab and navigates to the Google Chat developer documentation at
https://developers.google.com/workspace/chat".
Returns
(::String) — The alternative text that's used for accessibility.
Set descriptive text that lets users know what the button does. For
example, if a button opens a hyperlink, you might write: "Opens a new
browser tab and navigates to the Google Chat developer documentation at
https://developers.google.com/workspace/chat".
#color
defcolor()->::Google::Type::Color
Returns
(::Google::Type::Color) — If set, the button is filled with a solid background color and the font
color changes to maintain contrast with the background color. For example,
setting a blue background likely results in white text.
If unset, the image background is white and the font color is blue.
For red, green, and blue, the value of each field is afloatnumber that
you can express in either of two ways: as a number between 0 and 255
divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
the absence of a color and 1 or 255/255 represent the full presence of that
color on the RGB scale.
Optionally setalpha, which sets a level of transparency using this
equation:
value(::Google::Type::Color) — If set, the button is filled with a solid background color and the font
color changes to maintain contrast with the background color. For example,
setting a blue background likely results in white text.
If unset, the image background is white and the font color is blue.
For red, green, and blue, the value of each field is afloatnumber that
you can express in either of two ways: as a number between 0 and 255
divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
the absence of a color and 1 or 255/255 represent the full presence of that
color on the RGB scale.
Optionally setalpha, which sets a level of transparency using this
equation:
(::Google::Type::Color) — If set, the button is filled with a solid background color and the font
color changes to maintain contrast with the background color. For example,
setting a blue background likely results in white text.
If unset, the image background is white and the font color is blue.
For red, green, and blue, the value of each field is afloatnumber that
you can express in either of two ways: as a number between 0 and 255
divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
the absence of a color and 1 or 255/255 represent the full presence of that
color on the RGB scale.
Optionally setalpha, which sets a level of transparency using this
equation:
(::Google::Apps::Card::V1::OnClick) — Required. The action to perform when a user clicks the button, such as
opening a hyperlink or running a custom function.
value(::Google::Apps::Card::V1::OnClick) — Required. The action to perform when a user clicks the button, such as
opening a hyperlink or running a custom function.
Returns
(::Google::Apps::Card::V1::OnClick) — Required. The action to perform when a user clicks the button, such as
opening a hyperlink or running a custom function.
#text
deftext()->::String
Returns
(::String) — The text displayed inside the button.
#text=
deftext=(value)->::String
Parameter
value(::String) — The text displayed inside the button.
Returns
(::String) — The text displayed inside the button.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Chat V1 API - Class Google::Apps::Card::V1::Button (v0.14.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.14.0 (latest)](/ruby/docs/reference/google-apps-chat-v1/latest/Google-Apps-Card-V1-Button)\n- [0.13.0](/ruby/docs/reference/google-apps-chat-v1/0.13.0/Google-Apps-Card-V1-Button)\n- [0.12.0](/ruby/docs/reference/google-apps-chat-v1/0.12.0/Google-Apps-Card-V1-Button)\n- [0.11.1](/ruby/docs/reference/google-apps-chat-v1/0.11.1/Google-Apps-Card-V1-Button)\n- [0.10.0](/ruby/docs/reference/google-apps-chat-v1/0.10.0/Google-Apps-Card-V1-Button)\n- [0.9.1](/ruby/docs/reference/google-apps-chat-v1/0.9.1/Google-Apps-Card-V1-Button)\n- [0.8.0](/ruby/docs/reference/google-apps-chat-v1/0.8.0/Google-Apps-Card-V1-Button)\n- [0.7.0](/ruby/docs/reference/google-apps-chat-v1/0.7.0/Google-Apps-Card-V1-Button)\n- [0.6.0](/ruby/docs/reference/google-apps-chat-v1/0.6.0/Google-Apps-Card-V1-Button)\n- [0.5.1](/ruby/docs/reference/google-apps-chat-v1/0.5.1/Google-Apps-Card-V1-Button)\n- [0.4.0](/ruby/docs/reference/google-apps-chat-v1/0.4.0/Google-Apps-Card-V1-Button)\n- [0.3.1](/ruby/docs/reference/google-apps-chat-v1/0.3.1/Google-Apps-Card-V1-Button)\n- [0.2.0](/ruby/docs/reference/google-apps-chat-v1/0.2.0/Google-Apps-Card-V1-Button)\n- [0.1.2](/ruby/docs/reference/google-apps-chat-v1/0.1.2/Google-Apps-Card-V1-Button) \nReference documentation and code samples for the Google Chat V1 API class Google::Apps::Card::V1::Button.\n\nA text, icon, or text and icon button that users can click. For an example in\nGoogle Chat apps, see\n[Add a\nbutton](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button).\n\n\nTo make an image a clickable button, specify an\n[`Image`](/ruby/docs/reference/google-apps-chat-v1/latest/Google-Apps-Card-V1-Image \"Google::Apps::Card::V1::Image (class)\") (not an\n[`ImageComponent`](/ruby/docs/reference/google-apps-chat-v1/latest/Google-Apps-Card-V1-ImageComponent \"Google::Apps::Card::V1::ImageComponent (class)\")) and set an\n`onClick` action.\n\n\u003cbr /\u003e\n\n[Google Workspace\nAdd-ons and Chat apps](https://developers.google.com/workspace/extend): \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #alt_text\n\n def alt_text() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The alternative text that's used for accessibility.\n\n Set descriptive text that lets users know what the button does. For\n example, if a button opens a hyperlink, you might write: \"Opens a new\n browser tab and navigates to the Google Chat developer documentation at\n https://developers.google.com/workspace/chat\".\n\n### #alt_text=\n\n def alt_text=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The alternative text that's used for accessibility.\n\n\n Set descriptive text that lets users know what the button does. For\n example, if a button opens a hyperlink, you might write: \"Opens a new\n browser tab and navigates to the Google Chat developer documentation at\nhttps://developers.google.com/workspace/chat\". \n**Returns**\n\n- (::String) --- The alternative text that's used for accessibility.\n\n Set descriptive text that lets users know what the button does. For\n example, if a button opens a hyperlink, you might write: \"Opens a new\n browser tab and navigates to the Google Chat developer documentation at\n https://developers.google.com/workspace/chat\".\n\n### #color\n\n def color() -\u003e ::Google::Type::Color\n\n**Returns**\n\n- ([::Google::Type::Color](./Google-Type-Color)) --- If set, the button is filled with a solid background color and the font color changes to maintain contrast with the background color. For example, setting a blue background likely results in white text.\n\n\n If unset, the image background is white and the font color is blue.\n\n For red, green, and blue, the value of each field is a `float` number that\n you can express in either of two ways: as a number between 0 and 255\n divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents\n the absence of a color and 1 or 255/255 represent the full presence of that\n color on the RGB scale.\n\n Optionally set `alpha`, which sets a level of transparency using this\n equation:\n\n `\n pixel color = alpha * (this color) + (1.0 - alpha) * (background color)\n `\n\n For `alpha`, a value of `1` corresponds with a solid color, and a value of\n `0` corresponds with a completely transparent color.\n\n For example, the following color represents a half transparent red:\n\n `\n \"color\": {\n \"red\": 1,\n \"green\": 0,\n \"blue\": 0,\n \"alpha\": 0.5\n }\n `\n\n### #color=\n\n def color=(value) -\u003e ::Google::Type::Color\n\n**Parameter**\n\n- **value** ([::Google::Type::Color](./Google-Type-Color)) --- If set, the button is filled with a solid background color and the font color changes to maintain contrast with the background color. For example, setting a blue background likely results in white text.\n\n\n If unset, the image background is white and the font color is blue.\n\n For red, green, and blue, the value of each field is a `float` number that\n you can express in either of two ways: as a number between 0 and 255\n divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents\n the absence of a color and 1 or 255/255 represent the full presence of that\n color on the RGB scale.\n\n Optionally set `alpha`, which sets a level of transparency using this\n equation:\n\n `\n pixel color = alpha * (this color) + (1.0 - alpha) * (background color)\n `\n\n For `alpha`, a value of `1` corresponds with a solid color, and a value of\n `0` corresponds with a completely transparent color.\n\n For example, the following color represents a half transparent red:\n\n `\n \"color\": {\n \"red\": 1,\n \"green\": 0,\n \"blue\": 0,\n \"alpha\": 0.5\n }\n` \n**Returns**\n\n- ([::Google::Type::Color](./Google-Type-Color)) --- If set, the button is filled with a solid background color and the font color changes to maintain contrast with the background color. For example, setting a blue background likely results in white text.\n\n\n If unset, the image background is white and the font color is blue.\n\n For red, green, and blue, the value of each field is a `float` number that\n you can express in either of two ways: as a number between 0 and 255\n divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents\n the absence of a color and 1 or 255/255 represent the full presence of that\n color on the RGB scale.\n\n Optionally set `alpha`, which sets a level of transparency using this\n equation:\n\n `\n pixel color = alpha * (this color) + (1.0 - alpha) * (background color)\n `\n\n For `alpha`, a value of `1` corresponds with a solid color, and a value of\n `0` corresponds with a completely transparent color.\n\n For example, the following color represents a half transparent red:\n\n `\n \"color\": {\n \"red\": 1,\n \"green\": 0,\n \"blue\": 0,\n \"alpha\": 0.5\n }\n `\n\n### #disabled\n\n def disabled() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- If `true`, the button is displayed in an inactive state and doesn't respond to user actions.\n\n### #disabled=\n\n def disabled=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- If `true`, the button is displayed in an inactive state and doesn't respond to user actions. \n**Returns**\n\n- (::Boolean) --- If `true`, the button is displayed in an inactive state and doesn't respond to user actions.\n\n### #icon\n\n def icon() -\u003e ::Google::Apps::Card::V1::Icon\n\n**Returns**\n\n- ([::Google::Apps::Card::V1::Icon](./Google-Apps-Card-V1-Icon)) --- The icon image. If both `icon` and `text` are set, then the icon appears before the text.\n\n### #icon=\n\n def icon=(value) -\u003e ::Google::Apps::Card::V1::Icon\n\n**Parameter**\n\n- **value** ([::Google::Apps::Card::V1::Icon](./Google-Apps-Card-V1-Icon)) --- The icon image. If both `icon` and `text` are set, then the icon appears before the text. \n**Returns**\n\n- ([::Google::Apps::Card::V1::Icon](./Google-Apps-Card-V1-Icon)) --- The icon image. If both `icon` and `text` are set, then the icon appears before the text.\n\n### #on_click\n\n def on_click() -\u003e ::Google::Apps::Card::V1::OnClick\n\n**Returns**\n\n- ([::Google::Apps::Card::V1::OnClick](./Google-Apps-Card-V1-OnClick)) --- Required. The action to perform when a user clicks the button, such as opening a hyperlink or running a custom function.\n\n### #on_click=\n\n def on_click=(value) -\u003e ::Google::Apps::Card::V1::OnClick\n\n**Parameter**\n\n- **value** ([::Google::Apps::Card::V1::OnClick](./Google-Apps-Card-V1-OnClick)) --- Required. The action to perform when a user clicks the button, such as opening a hyperlink or running a custom function. \n**Returns**\n\n- ([::Google::Apps::Card::V1::OnClick](./Google-Apps-Card-V1-OnClick)) --- Required. The action to perform when a user clicks the button, such as opening a hyperlink or running a custom function.\n\n### #text\n\n def text() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The text displayed inside the button.\n\n### #text=\n\n def text=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The text displayed inside the button. \n**Returns**\n\n- (::String) --- The text displayed inside the button."]]