按鈕
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
按鈕可協助使用者啟動動作或流程。選擇不同類型的按鈕,以便傳達強調效果。

資源
重點特色
- 請根據動作的重要性選擇按鈕類型。動作越重要,按鈕就越醒目。
- 按鈕應附有清楚的標籤,指出所執行的動作。
- 在螢幕上以邏輯方式放置按鈕,也就是使用者可能會預期找到按鈕的位置。
- 請勿過度使用按鈕。畫面上的按鈕過多會破壞視覺階層。
按鈕分為六種類型:
- 填滿型按鈕
- 外框按鈕
- 圖示按鈕
- 外框圖示按鈕
- 長按按鈕
- 圖片按鈕
請根據動作的重要性選擇按鈕類型。動作的重要性越高,按鈕的強調程度就應越高。

填滿的按鈕具有最強烈的視覺效果,應用於完成流程的重要最終動作,例如「儲存」、「立即加入」、「確認」或「下載」。
外框按鈕是指中強調按鈕。這些按鈕包含重要的動作,但不是應用程式中的主要動作。輪廓按鈕與填充按鈕搭配使用,可用於指出次要動作。
圖解

- 容器
- 標籤文字
- 圖示 (選用)
狀態
元件狀態的視覺呈現。

- 預設
- 專注
- 已按下
規格

使用圖示按鈕,在緊湊的版面配置中顯示動作。圖示按鈕可代表開啟動作,例如開啟溢出選單或搜尋,或代表可切換開啟/關閉的二元動作,例如收藏或書籤。也用於播放或暫停媒體。
圖示按鈕可定義三種大小:小、中和大。
圖解

- 容器
- Icon
狀態

- 預設
- 專注
- 已按下
狀態是用來傳達元件或互動元素狀態的視覺化呈現方式。
規格

寬按鈕比一般按鈕更強調。其中包含重要的動作。代表相關選項的按鈕會分組顯示。群組應共用相同的介面。

- 容器
- 前置圖示
- 標題
- 副標題

- 預設
- 專注
- 已按下
狀態是用來傳達元件或互動元素狀態的視覺化呈現方式。

圖片按鈕通常用於顯示下一層級導覽中可用的內容縮圖。通常會與相關動作一同分組,且群組應共用相同的介面。

- 容器
- 前置圖示
- 標題
- 副標題
- 圖片圖層,包含:
- 紗罩 (狀態重疊)
- 漸層 (根據表面顏色)
- 圖片

- 預設
- 專注
- 已按下
狀態是用來傳達元件或互動元素狀態的視覺化呈現方式。

用量
按鈕通常用於傳達使用者可採取的動作。這類元素經常出現在對話方塊、模式視窗、表單、資訊卡和工具列等 UI 元素中。
按鈕只是在 UI 中表示動作的一種方式。請勿過度使用。畫面上的按鈕過多會破壞視覺階層。

- 容器
- Icon
- 標籤文字
- 標題
- 副標題
- 圖片
按鈕會在內容周圍顯示容器。容器會在聚焦時縮放 1.1 倍,並保留內部邊框間距。以下是容器的幾點注意事項:
- 根據內容設定容器寬度,並維持一致的邊框間距。
- 將容器的相對位置設為回應式版面配置格狀。
- 請為填滿的按鈕使用單色容器。
- 請在聚焦時使用輪廓按鈕的筆觸和填充顏色。在聚焦時,容器會取得填滿顏色和外框。
- 對於寬和圖片按鈕,容器寬度會根據版面配置格線設定。
- 容器大小、位置和對齊方式會隨著父項容器的縮放而變更。

文字和圖示按鈕容器的圓角為完全圓角。寬型和圖片按鈕容器的圓角容器為 12dp。
check_circle
正確做法
填滿型按鈕的寬度可回應版面配置格線。按鈕寬度增加時,圖示和標籤文字仍會置中顯示。
warning
注意
對於寬型和圖片按鈕,容器寬度是由父項容器定義。內容錨點位於左側。
Icon
圖示可視覺化呈現按鈕的動作,並吸引使用者注意。應放置在按鈕的前端。圖示一律會在容器內垂直置中。
check_circle
正確做法
不同大小的圖示按鈕可分組顯示。
cancel
錯誤做法
請勿將圖示和文字垂直對齊,置於按鈕中央
warning
注意
請勿在同一個按鈕中使用兩個圖示
標籤文字
標籤文字是按鈕最重要的元素。它會說明使用者輕觸按鈕時會發生的動作。
請使用句首大寫的格式輸入按鈕標籤文字,並將第一個字和專有名詞的首字母大寫。避免文字斷行。為確保最佳可讀性,標籤文字應保持在單一行。
check_circle
正確做法
請使用句子大小寫格式為按鈕標籤文字,並將第一個字詞和專有名詞的首字母大寫。
warning
注意
在圖片上方放置有邊框的按鈕時,請確保標籤文字清晰可讀;使用遮罩來維持對比。
圖片
圖片按鈕一律會在背景圖片上方顯示漸層疊加和遮罩。漸層疊加畫面會根據容器顏色設定。遮罩會根據狀態而變更。
按鈕會在資料列或欄中一同顯示,以便在各項動作之間維持一致的導覽體驗。以下各節將說明相關注意事項。
每個畫面都應有一個主要動作,並以醒目 (通常是寬廣) 的按鈕呈現。按鈕應更容易看見及理解。其他按鈕應較不顯眼,且不得分散使用者對主要動作的注意力。
群組中的第一個按鈕會做為主要動作,因為焦點會先落在該按鈕上。
維持線性版面配置
- 資料列版面配置
- 欄位版面配置
以邏輯方式使用變化版本
在欄式版面配置中,應保留單一按鈕變化版本。在資料列版面配置中,您可以在按鈕群組中將不同變化版本分組,但邏輯應明確。您可以在同一個群組中使用填滿和外框按鈕,但請確保動作的階層清楚。
check_circle
正確做法
在按鈕群組中使用相同的按鈕變化版本。
cancel
錯誤做法
在按鈕群組中混合使用長按鈕和圖像按鈕。
warning
注意
在列版面配置中,文字和圖示按鈕可以放在一起。請確保主要按鈕的強調程度較高。
check_circle
正確做法
在欄形式版面配置中,請只使用一個按鈕變化版本。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Buttons help users initiate actions or flow. Choose from different\ntypes of buttons to inform emphasis.\n\nResources\n---------\n\n| Type | Link | Status |\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|\n| Design | [Design source (Figma)](https://goo.gle/tv-desing-kit) | Available |\n| Implementation | [Jetpack Compose](/reference/kotlin/androidx/tv/material3/package-summary#Button(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Boolean,androidx.tv.material3.ButtonScale,androidx.tv.material3.ButtonGlow,androidx.tv.material3.ButtonShape,androidx.tv.material3.ButtonColors,androidx.compose.ui.unit.Dp,androidx.tv.material3.ButtonBorder,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function1)) | Available |\n\nHighlights\n----------\n\n- Choose the type of button based on the importance of the action. The more important the action is, the more emphasis on the button.\n- Buttons should have clear labels to indicate the action they perform.\n- Place buttons logically on the screen---where users likely expect to find them.\n- Don't overuse buttons. Too many buttons on a screen disrupt the visual hierarchy.\n\nVariants\n--------\n\nThere are six types of buttons:\n\n1. Filled button\n2. Outline button\n3. Icon button\n4. Outline icon button\n5. Long button\n6. Image button\n\nChoose the type of button based on the importance of the action.\nThe more important the action is, the more emphasis its button should have.\n\nFilled and outline button\n-------------------------\n\nFilled buttons have the most visual impact and should be used for important,\nfinal actions that complete a flow, like Save, Join now, Confirm, or Download.\n\nOutlined buttons are medium emphasis buttons. They contain actions that are\nimportant, but aren't the primary action in an app. Outlined buttons pair\nwell with filled buttons to indicate an alternative, secondary action.\n\n### Anatomy\n\n1. Container\n2. Label text\n3. Icon (optional)\n\n### States\n\nVisual representation of a component's status.\n\n1. Default\n2. Focused\n3. Pressed\n\n### Specification\n\nIcon and outline icon button\n----------------------------\n\nUse icon buttons to display actions in a compact layout. Icon buttons can\nrepresent opening actions such as opening an overflow menu or search, or\nrepresent binary actions that can be toggled on and off, such as favorite or\nbookmark. They are also used to play or pause media.\n\nIcon buttons can be defined in three sizes: small, medium and large.\n\n### Anatomy\n\n1. Container\n2. Icon\n\n### States\n\n1. Default\n2. Focused\n3. Pressed\n\nStates are visual representations used to communicate the status of\na component or interactive element.\n\n### Spec\n\nWide button\n-----------\n\nWide buttons are used for higher-emphasis than usual buttons.\nThey contain actions that are important. Buttons that represent related\noptions are grouped together. The group should share a common surface.\n\n### Anatomy\n\n1. Container\n2. Leading icon\n3. Title\n4. Subtitle\n\n### States\n\n1. Default\n2. Focused\n3. Pressed\n\nStates are visual representations used to communicate the status of\na component or interactive element.\n\n### Specifications\n\nImage button\n------------\n\nImage buttons are typically used to display thumbnails of the content that\nis available in the next level of navigation. They are usually grouped\ntogether with related actions, and the group should share a common surface.\n\n### Anatomy\n\n1. Container\n2. Leading icon\n3. Title\n4. Subtitle\n5. Image layer, which consists of:\n 1. Scrim (state overlay)\n 2. Gradient (based on surface color)\n 3. Image\n\n### States\n\n1. Default\n2. Focused\n3. Pressed\n\nStates are visual representations used to communicate the status of\na component or interactive element.\n\n### Spec\n\nUsage\n-----\n\nButtons are generally used to communicate actions that a user can take.\nThey are frequently found in UI elements such as dialogs, modal windows,\nforms, cards, and toolbars.\n\nButtons are just one option for representing actions in your UI. Don't\noveruse them. Too many buttons on a screen disrupts the visual hierarchy.\n\n1. Container\n2. Icon\n3. Label text\n4. Title\n5. Subtitle\n6. Image\n\n### Container\n\nButtons display a container around content. The container scales by 1.1x on\nfocus, maintaining the internal padding. Here are some considerations\nfor container:\n\n- Set container width based on content with consistent padding.\n- Set the container's relative position to the responsive layout grid.\n- Use solid color containers for filled buttons.\n- Use stroke and fill color on focus for outlined buttons. On focus, the container gets a fill color along with outline.\n- For wide and image buttons, container width is set according to the layout grid.\n- Container size, position, and alignment can change as its parent container scales.\n\nText and icon button containers have fully rounded corners. Wide and\nimage button containers have rounded containers of 12dp. \ncheck_circle\n\n### Do\n\nFilled button width can be responsive to the layout grid. Icons and label text remain centered when button width increases. \nwarning\n\n### Caution\n\nFor wide and image buttons, container width is defined by the parent container. Content anchors to the left.\n\n### Icon\n\nIcons visually communicate the button's action and help draw attention.\nThey should be placed on the leading side of the button. Icons are\nalways vertically centered within the container. \ncheck_circle\n\n### Do\n\nIcon buttons with different sizes can be grouped together. \ncancel\n\n### Don't\n\nDon't vertically align an icon and text in the center of a button \nwarning\n\n### Caution\n\nDon't use two icons in the same button\n\n### Label text\n\nLabel text is the most important element of a button. It describes\nthe action that occurs if a user taps a button.\n\nUse sentence case for button label text, capitalizing the first word\nand proper nouns. Avoid wrapping text. For maximum legibility, label text\nshould remain on a single line. \ncheck_circle\n\n### Do\n\nUse sentence case for button label text, capitalizing the first word and proper nouns. \nwarning\n\n### Caution\n\nEnsure legibility for label text when placing outlined buttons on top of images; use scrims to maintain contrast.\n\n### Image\n\nImage buttons always have a gradient overlay and scrim on top of the image in\nthe background. The gradient overlay is set according to container color.\nThe scrim changes according to state.\n\nButton groups\n-------------\n\nButtons appear together in a row or column to maintain consistent\nnavigation between actions. The following sections describe considerations.\n\n### Inform hierarchy\n\nEach screen should have one primary action that is represented by a prominent,\ntypically wide, button. The button should be easier to see and understand.\nOther buttons should be less prominent and shouldn't distract users from\nthe primary action.\n\nThe first button in the group acts as the primary action since focus\nlands on it first.\n\n### Maintain linear layout\n\n\n\u003cbr /\u003e\n\n1. Row layout\n2. Column layout\n\n### Use variants logically\n\nIn column layout, single button variants should be maintained. In\nrow layout, different variants can be clustered together in a button group\nbut the logic should be clear. Filled and outline buttons can be used in\nthe same group, but ensure clear hierarchy for actions. \ncheck_circle\n\n### Do\n\nUse the same button variants in a button group. \ncancel\n\n### Don't\n\nMix long buttons and image buttons in a button group. \nwarning\n\n### Caution\n\nIn row layout, text and icon buttons can be placed together. Ensure that the primary button has higher emphasis. \ncheck_circle\n\n### Do\n\nIn column layout, use only one button variant."]]