StepIndicatorAPI
React StepIndicator 元件的 API 參考文件。瞭解此匯出模組的 props、CSS 和其他 API。
示範
Import
import StepIndicator from '@mui/joy/StepIndicator';
// or
import { StepIndicator } from '@mui/joy';
透過閱讀這份關於最小化套件大小的指南,瞭解它們之間的差異。
原生元件的 Props 也可使用。
名稱 | 類型 | 預設值 | 描述 |
---|---|---|---|
children | node | - | 若未設定 |
color | 'danger' | 'neutral' | 'primary' | 'success' | 'warning' | string | 'neutral' | 元件的顏色。它支援適用於此元件的那些主題顏色。 若要瞭解如何新增自己的顏色,請查看主題元件—擴充顏色。 |
component | elementType | - | 用於根節點的元件。可以是字串(用於 HTML 元素)或元件。 |
slotProps | { root?: func | object } | {} | 用於內部每個 slot 的 props。 |
slots | { root?: elementType } | {} | 用於內部每個 slot 的元件。 請參閱下方的Slots API以瞭解更多詳細資訊。 |
sx | Array<func | object | bool> | func | object | - | 允許定義系統覆寫以及額外 CSS 樣式的系統 prop。 請參閱`sx` 頁面以瞭解更多詳細資訊。 |
variant | 'outlined' | 'plain' | 'soft' | 'solid' | string | 'soft' | 要使用的全域 variant。 若要瞭解如何新增自己的 variants,請查看主題元件—擴充 variants。 |
ref
轉發到根元素。主題預設 Props
您可以使用 JoyStepIndicator
透過主題變更此元件的預設 props。
若要瞭解如何自訂 slot,請查看覆寫元件結構指南。
Slot 名稱 | 類別名稱 | 預設元件 | 描述 |
---|---|---|---|
root | .MuiStepIndicator-root | 'div' | 渲染 root 的元件。 |
這些類別名稱對於使用 CSS 設定樣式很有用。當觸發特定狀態時,它們會套用至元件的 slots。
類別名稱 | 規則名稱 | 描述 |
---|---|---|
.MuiStepIndicator-colorContext | colorContext | 當觸發顏色反轉時,套用至根元素的類別名稱。 |
.MuiStepIndicator-colorDanger | colorDanger | 若 color="danger" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-colorNeutral | colorNeutral | 若 color="neutral" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-colorPrimary | colorPrimary | 若 color="primary" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-colorSuccess | colorSuccess | 若 color="success" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-colorWarning | colorWarning | 若 color="warning" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-horizontal | horizontal | 若 orientation="horizontal" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-variantOutlined | variantOutlined | 若 variant="outlined" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-variantPlain | variantPlain | 若 variant="plain" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-variantSoft | variantSoft | 若 variant="soft" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-variantSolid | variantSolid | 若 variant="solid" ,則套用至根元素的類別名稱。 |
.MuiStepIndicator-vertical | vertical | 若 orientation="vertical" ,則套用至根元素的類別名稱。 |
您可以使用以下其中一種自訂選項來覆寫元件的樣式
- 使用全域類別名稱。
- 在自訂主題中使用規則名稱作為元件
styleOverrides
屬性的一部分。
原始碼
如果您在此頁面中找不到資訊,請考慮查看元件的實作以取得更多詳細資訊。