Result Result
LhResult result feedback page: status icon, title, subtitle and extra actions with role="status".
Basic Usage
Four Statuses
Success
Warning
Error
Info
vue
<script setup lang="ts">
import { LhResult } from '@lh-ui/vue3'
const t1 = {
success: 'Success',
warning: 'Warning',
error: 'Error',
info: 'Info',
}
</script>
<template>
<div class="demo-row">
<LhResult status="success" :title="t1.success" />
<LhResult status="warning" :title="t1.warning" />
<LhResult status="error" :title="t1.error" />
<LhResult status="info" :title="t1.info" />
</div>
</template>vue
<script>
import { LhResult } from '@lh-ui/vue3'
export default {
components: { LhResult },
data() {
return {
t1: {
success: 'Success',
warning: 'Warning',
error: 'Error',
info: 'Info',
},
}
},
}
</script>
<template>
<div class="demo-row">
<LhResult status="success" :title="t1.success" />
<LhResult status="warning" :title="t1.warning" />
<LhResult status="error" :title="t1.error" />
<LhResult status="info" :title="t1.info" />
</div>
</template>Subtitle & Extra
Validation failed
Please check the highlighted fields and retry
vue
<script setup lang="ts">
import { LhResult } from '@lh-ui/vue3'
const t2 = {
warnTitle: 'Validation failed',
warnSub: 'Please check the highlighted fields and retry',
}
</script>
<template>
<LhResult
status="warning"
:title="t2.warnTitle"
:sub-title="t2.warnSub"
>
<template #extra>
<LhButton type="primary">Back and retry</LhButton>
</template>
</LhResult>
</template>vue
<script>
import { LhResult } from '@lh-ui/vue3'
export default {
components: { LhResult },
data() {
return {
t2: {
warnTitle: 'Validation failed',
warnSub: 'Please check the highlighted fields and retry',
},
}
},
}
</script>
<template>
<LhResult
status="warning"
:title="t2.warnTitle"
:sub-title="t2.warnSub"
>
<template #extra>
<LhButton type="primary">Back and retry</LhButton>
</template>
</LhResult>
</template>Result API
Props
| Name | Description | Type | Default |
|---|---|---|---|
| status | Result status | "success" | "warning" | "info" | "error" | 'info' |
| icon | Custom icon name (empty string hides the icon) | string | — |
| iconSize | Icon size | string | number | 64 |
| title | Title (or title slot) | string | '' |
| subTitle | Subtitle (or subTitle slot) | string | '' |
| sx | Quick layout props | LhSxProps | — |
Slots
| Name | Description |
|---|---|
| title | Title |
| subTitle | Subtitle |
| extra | Extra actions |
Accessibility
- The container is
role="status": announced when the result appears
Type Definitions
The TypeScript type structures exported by this component (auto-extracted from packages/components/result/src/types.ts and @lh-ui/share/core/* sources; click each entry to expand; see the Props table above for attribute descriptions):
LhResultProps
ts
export interface LhResultProps {
status?: LhResultStatus
icon?: string
iconSize?: string | number
title?: string
subTitle?: string
sx?: LhSxProps
}
