Result 結果頁
操作結果的回饋頁:狀態決定圖示與配色,可帶副標題與操作區。
基礎用法
基礎用法
提交成功
已按約定時間交付,重要檔案已歸檔。
提交失敗
網路異常,部分內容未能儲存。
警告提示
資訊提示
import { LhResult, LhButton } from '@lh-ui/react'
export default function Demo() {
return (
<>
<LhResult
status="success"
title="提交成功"
subTitle="已按約定時間交付,重要檔案已歸檔。"
/>
<LhResult
status="warning"
title="警告提示"
extra={<LhButton type="primary">重新載入</LhButton>}
/>
</>
)
}
Result Props
| 屬性 | 說明 | 類型 | 可選值 | 預設值 |
|---|---|---|---|---|
| status | 結果狀態(決定圖示與配色) | LhResultStatus | 'success' | 'warning' | 'info' | 'error' | 'info' |
| icon | 自訂圖示名稱(覆蓋狀態預設圖示;空字串=不要圖示) | string | LhIcon 圖示集 | — |
| iconSize | 圖示尺寸(傳給 LhIcon) | string | number | — | 64 |
| title | 標題 | ReactNode | — | — |
| subTitle | 副標題(傳入即渲染) | ReactNode | — | — |
| extra | 底部操作區(按鈕等) | ReactNode | — | — |
| sx | 快速版面屬性 | SxProps | — | — |
狀態非法降級
status 非法時交由 core 白名單兜底到 info,不會輸出未知的 --xxx 修飾類別。
無障礙
根元素為 role="status"(溫和播報,不打斷讀屏);圖示位由 LhIcon 自身的無障礙語義承接。
樣式
import '@lh-ui/react/style/result'