Empty

Compact empty-state wrapper for panels, filtered results, and first-run placeholders.

VerifiedSince 0.3.4

Usage

Empty

Loading demo...

Empty (action)

Loading demo...

Best Practices

  • Use TxEmpty for compact list, search, or panel placeholders where the card surface is desirable.
  • Use the more explicit TxNoData, TxNoSelection, TxOfflineState, or TxPermissionState when the empty cause has product meaning.
  • Keep compact for dense regions such as sidebars and table interiors.
  • Put clickable behavior inside the action slot; TxEmpty does not proxy action events.

API Reference

Props

PropTypeDefaultDescription
titlestring'Nothing here'Primary empty-state message.
descriptionstring''Supporting text shown below the title.
iconClassstring'i-carbon-incomplete'Icon class forwarded to the wrapped TxEmptyState.
compactbooleanfalseUses the small empty-state size for dense panels.

Events

TxEmpty does not emit component events. Place click handlers on controls rendered inside the action slot.

Slots

SlotPropsDescription
icon-Replaces the icon rendered by iconClass.
title-Replaces the title prop content.
description-Replaces the description prop content.
action-Replaces the wrapped TxEmptyState actions area.

Overview

  • Always renders the wrapped TxEmptyState with variant="empty", surface="card", and layout="vertical".
  • compact=false maps to size="medium"; compact=true maps to size="small".
  • iconClass is forwarded as the wrapped empty-state icon prop.
  • Slots are intentionally simpler than TxEmptyState: action is singular and replaces the wrapped actions slot.
  • No events are emitted by TxEmpty; action behavior belongs to the slotted control.

Technologies

  • Source: packages/tuffex/packages/components/src/empty/src/TxEmpty.vue confirms TxEmptyState wrapping, forced variant="empty", surface="card", layout="vertical", compact size mapping, and slot remapping.
  • Type contract: packages/tuffex/packages/components/src/empty/src/types.ts defines the compact EmptyProps surface.
  • Verified coverage: Coverage: packages/tuffex/packages/components/src/empty/__tests__/empty.test.ts covers default prop forwarding, compact sizing, and wrapper-to-empty-state slot mapping.
  • Export: packages/tuffex/packages/components/src/empty/index.ts exports Empty, TxEmpty, EmptyProps, and TxEmptyInstance.
查看源码
packages/tuffex/packages/components/src/empty/index.ts