Skip to content

Result

Used to provide feedback on the results of a series of operations or tasks.

Basic Usage

The simplest way to use it, by setting the icon, title, and sub-title props.

Operation Successful
Your order has been submitted successfully, expected delivery in 3-5 business days.
Basic Usage

Different Statuses

Set different status icons via the icon prop: success, warning, error, info.

Success
Submitted successfully
Warning
Please note this operation
Error
Submission failed, please try again
Information
This is a prompt message
Different Statuses

Custom Content

Customize the icon and extra content areas via #icon and #extra slots. The default slot is used for action buttons.

🔍
404
Sorry, the page you visited does not exist

Please check if the URL is correct, or return to home.

Custom Content

Use in Nuxt

Result component fully supports Nuxt 3/4 SSR rendering. The following example demonstrates using Result as the error.vue global error page in Nuxt, combined with Nuxt-exclusive APIs like useError and clearError to dynamically respond to different HTTP error codes.

404
Sorry, the page you visited does not exist
Nuxt Usage (Mock error.vue)

SSR Notes:

  • ✅ All Props and styles fully supported
  • ✅ SVG icons render correctly
  • ✅ Slot content (icon, title, sub-title, extra, default) fully rendered
  • ✅ Can be used as Nuxt's error.vue error page
  • ✅ Dynamic status (icon type switching) works normally

SSR Safety

Result component has passed complete SSR tests, ensuring that server-side and client-side rendering are completely consistent with no Hydration errors.

API

Props

PropDescriptionTypeDefault
titleTitlestring
subTitleSub-titlestring
iconIcon type'success' | 'warning' | 'error' | 'info''info'
themeOverridesTheme overridesComponentThemeVars

Slots

SlotDescription
defaultActions area (usually buttons)
iconCustom icon content
titleCustom title content
sub-titleCustom sub-title content
extraExtra content area (between sub-title and actions)

Theme Variables

Result supports customizing local styles by overriding the following CSS variables:

Variable NameDescriptionDefault
--yh-result-paddingContainer padding40px 30px
--yh-result-icon-sizeIcon size72px
--yh-result-icon-marginIcon margin bottom20px
--yh-result-title-sizeTitle font size20px
--yh-result-title-colorTitle colorvar(--yh-text-color-primary, #303133)
--yh-result-subtitle-sizeSub-title font size14px
--yh-result-subtitle-colorSub-title colorvar(--yh-text-color-secondary, #909399)

Released under the MIT License.