Skip to content
API 风格:

Empty ​

Placeholder for empty data. The container has role="status", so screen readers announce the empty state automatically.

Basic Usage ​

Basic Usage

No data

vue
<script setup lang="ts">
</script>

<template>
  <LhEmpty />
</template>
vue
<script>
export default {}
</script>

<template>
  <LhEmpty />
</template>

Custom Description ​

Custom Description

No search results

vue
<script setup lang="ts">
</script>

<template>
  <LhEmpty description="No search results" />
</template>
vue
<script>
export default {}
</script>

<template>
  <LhEmpty description="No search results" />
</template>

Custom Image ​

Custom Image

No orders yet

vue
<script setup lang="ts">
</script>

<template>
  <LhEmpty image="/logo.svg" description="No orders yet" />
</template>
vue
<script>
export default {}
</script>

<template>
  <LhEmpty image="/logo.svg" description="No orders yet" />
</template>

With Actions ​

With Actions

Nothing collected yet

vue
<script setup lang="ts">
</script>

<template>
  <LhEmpty description="Nothing collected yet">
    <template #actions>
      <LhButton type="primary" size="small">Browse</LhButton>
      <LhButton size="small">Refresh</LhButton>
    </template>
  </LhEmpty>
</template>
vue
<script>
export default {}
</script>

<template>
  <LhEmpty description="Nothing collected yet">
    <template #actions>
      <LhButton type="primary" size="small">Browse</LhButton>
      <LhButton size="small">Refresh</LhButton>
    </template>
  </LhEmpty>
</template>

API ​

Props ​

PropDescriptionTypeDefault
descriptionDescription text (falls back to the empty.description locale message when unset)string—
imageCustom image URL (replaces the default inline illustration)string—
sxsx quick-layout propertiesLhSxProps—

Slots ​

SlotDescriptionDefault
defaultCustom visual area (replaces the illustration)Default ink-wash illustration
descriptionCustom descriptionLocale message empty.description
actionsAction area—

Accessibility ​

  • Container has role="status" — announced automatically when it appears
  • Decorative images use alt="" and are hidden from screen readers; semantics are carried by the description text

Type Definitions ​

The TypeScript type structures exported by this component (auto-extracted from packages/components/empty/src/types.ts and @lh-ui/share/core/* sources; click each entry to expand; see the Props table above for attribute descriptions):

LhEmptyProps
ts
export interface LhEmptyProps {
  description?: string
  image?: string
  sx?: LhSxProps
}

Beauty of tradition, foundation of code