Skip to contentSkip to content

ListSubheaderAPI

React ListSubheader 元件的 API 參考文件。了解此匯出模組的 props、CSS 和其他 API。

Demo

Import

import ListSubheader from '@mui/material/ListSubheader';
// or
import { ListSubheader } from '@mui/material';

閱讀這份關於最小化 bundle 大小的指南,以了解差異。

Props

原生元件的 Props 也可使用。

名稱類型預設值描述
childrennode-

元件的內容。

classesobject-

覆寫或擴展應用於元件的樣式。

請參閱下方CSS 類別 API 以了解更多詳細資訊。

color'default'
| 'inherit'
| 'primary'
'default'

元件的顏色。它支援適用於此元件的主題顏色。

componentelementType-

用於根節點的元件。可以是字串(使用 HTML 元素)或元件。

disableGuttersboolfalse

若為 true,List Subheader 將不會有 gutters。

disableStickyboolfalse

若為 true,List Subheader 在滾動期間不會黏在頂部。

insetboolfalse

若為 true,List Subheader 會縮排。

sxArray<func
| object
| bool>
| func
| object
-

允許定義系統覆寫以及額外 CSS 樣式的系統 prop。

請參閱 `sx` 頁面 以了解更多詳細資訊。

ref 會轉發到根元素。

主題預設 props

您可以使用 MuiListSubheader 來變更此元件的預設 props 透過主題

CSS 類別

這些類別名稱對於使用 CSS 設定樣式很有用。它們在觸發特定狀態時應用於元件的 slot。

類別名稱規則名稱描述
.MuiListSubheader-colorInheritcolorInheritcolor="inherit",則應用於根元素的樣式。
.MuiListSubheader-colorPrimarycolorPrimarycolor="primary",則應用於根元素的樣式。
.MuiListSubheader-guttersgutters除非 disableGutters={true},否則應用於內部 component 元素的樣式。
.MuiListSubheader-insetinsetinset={true},則應用於根元素的樣式。
.MuiListSubheader-rootroot應用於根元素的樣式。
.MuiListSubheader-stickysticky除非 disableSticky={true},否則應用於根元素的樣式。

您可以使用以下其中一種自訂選項來覆寫元件的樣式

原始碼

如果您在本頁中找不到資訊,請考慮查看元件的實作以取得更多詳細資訊。