Result
Used to inform the user about operational results (such as success, warning, system info, or failures). Features a distinct bold bordered square status box, robust header/description text, and action slot layouts.
Preview
成功状态 (Success)
支付成功
您的订单已支付完成,我们将在 24 小时内为您安排发货。您可以点击下方按钮查看物流详情。
错误状态 (Error)
提交失败
请检查您的表单输入,当前表单中包含冲突或格式不正确的配置。您可以修改后重新尝试。
警告与提示状态 (Warning / Info)
账户权限异常
检测到您的账户有安全隐患,请及时修改密码。
系统维护通知
本周六凌晨 2:00 - 4:00 系统将进行数据库维护。
Installation
pnpm dlx brutx-vue@latest add resultUsage
Basic Success Receipt
Show basic success receipts.
<script setup>
import { Result } from 'brutx-ui-vue'
</script>
<template>
<Result
status="success"
title="Payment Succeeded"
sub-title="Your payment has been cleared. Shipment will dispatch shortly."
/>
</template>Action Controls
Inject buttons inside the #extra slot layout to allow further navigation or retries.
<template>
<Result
status="error"
title="Submission Failed"
sub-title="Gateway timeout occurred. Please modify settings and try submitting again."
>
<template #extra>
<button class="btn btn-primary" @click="retry">Retry Now</button>
</template>
</Result>
</template>Empty State
Result supports status="empty" and is the recommended entry for empty states.
<template>
<Result
status="empty"
title="No data yet"
sub-title="Create your first record and it will appear here."
/>
</template>API Reference
| Name | Type | Default | Description |
|---|---|---|---|
status | "success" | "warning" | "info" | "error" | "empty" | undefined | "info" | Selects the result icon and color state: success, warning, info, error, or empty. An unknown runtime value falls back to info. |
DetailsDeclared type"success" | "warning" | "info" | "error" | "empty" | undefined Literal values
Default value details
Sourcepackages/ui/src/components/result/Result.vue | |||
title | string | undefined | undefined | The result title text; it can be replaced by the title slot. |
DetailsDeclared typestring | undefined Default value details
Sourcepackages/ui/src/components/result/Result.vue | |||
subTitle | string | undefined | undefined | The result subtitle or supporting description; it can be replaced by the subTitle slot. |
DetailsDeclared typestring | undefined Default value details
Sourcepackages/ui/src/components/result/Result.vue | |||
variant | "card" | "plain" | undefined | "card" | Selects the card layout with border and hard shadow, or the plain layout without card chrome. |
DetailsDeclared type"card" | "plain" | undefined Literal values
Default value details
Sourcepackages/ui/src/components/result/Result.vue | |||
iconSize | IconSize | undefined | undefined | Sets the status icon size. When omitted, the component uses its built-in 40px icon size. |
DetailsDeclared typeIconSize | undefined Literal values
Referenced types IconSize Type definition — IconSizeexport type IconSize = NonNullable<VariantProps<typeof iconSizeVariants>['size']> Default value details
Sourcepackages/ui/src/components/result/Result.vue | |||
titleAs | "h2" | "h3" | undefined | "h2" | Selects h2 or h3 as the semantic heading element for the title. |
DetailsDeclared type"h2" | "h3" | undefined Literal values
Default value details
Sourcepackages/ui/src/components/result/Result.vue | |||
class | string | undefined | undefined | Custom CSS classes appended to the result root container. |
DetailsDeclared typestring | undefined Default value details
Sourcepackages/ui/src/components/result/Result.vue | |||
| Name | Signature or type | Description |
|---|---|---|
#icon | {} | Replaces the default status icon and its icon box. This decorative icon area is hidden from assistive technology. |
DetailsDeclared type{}Sourcepackages/ui/src/components/result/Result.vue | ||
#title | {} | Replaces the result title content structure. |
DetailsDeclared type{}Sourcepackages/ui/src/components/result/Result.vue | ||
#subTitle | {} | Replaces the result subtitle content structure. |
DetailsDeclared type{}Sourcepackages/ui/src/components/result/Result.vue | ||
#extra | {} | Renders additional actions or supporting content below the title and subtitle. |
DetailsDeclared type{}Sourcepackages/ui/src/components/result/Result.vue | ||
Accessibility
- Semantic structure: The heading level is set via
titleAs(h2/h3); the subtitle is rendered as a<p>description. - Decorative icons: The status icon is marked
aria-hiddenso assistive technology does not announce meaningless icon names. - Color is not the only signal: Status colors (
--brutal-status-*) are decorative; the copy (title/subtitle) carries the meaning. Foreground follows the*-foregroundtoken for contrast (success/info black-on-color 8.6:1 / 5.8:1, passing WCAG AA). - Reduced motion: Respects
prefers-reduced-motion; no motion-critical behavior.