Empty
Compact empty-state wrapper for panels, filtered results, and first-run placeholders.
Usage
Empty
Loading demo...
Empty (action)
Loading demo...
Best Practices
- Use
TxEmptyfor compact list, search, or panel placeholders where the card surface is desirable. - Use the more explicit
TxNoData,TxNoSelection,TxOfflineState, orTxPermissionStatewhen the empty cause has product meaning. - Keep
compactfor dense regions such as sidebars and table interiors. - Put clickable behavior inside the
actionslot;TxEmptydoes not proxy action events.
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | 'Nothing here' | Primary empty-state message. |
description | string | '' | Supporting text shown below the title. |
iconClass | string | 'i-carbon-incomplete' | Icon class forwarded to the wrapped TxEmptyState. |
compact | boolean | false | Uses 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
| Slot | Props | Description |
|---|---|---|
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
TxEmptyStatewithvariant="empty",surface="card", andlayout="vertical". compact=falsemaps tosize="medium";compact=truemaps tosize="small".iconClassis forwarded as the wrapped empty-stateiconprop.- Slots are intentionally simpler than
TxEmptyState:actionis singular and replaces the wrappedactionsslot. - No events are emitted by
TxEmpty; action behavior belongs to the slotted control.
Technologies
- Source:
packages/tuffex/packages/components/src/empty/src/TxEmpty.vueconfirmsTxEmptyStatewrapping, forcedvariant="empty",surface="card",layout="vertical", compact size mapping, and slot remapping. - Type contract:
packages/tuffex/packages/components/src/empty/src/types.tsdefines the compactEmptyPropssurface. - Verified coverage: Coverage:
packages/tuffex/packages/components/src/empty/__tests__/empty.test.tscovers default prop forwarding, compact sizing, and wrapper-to-empty-state slot mapping. - Export:
packages/tuffex/packages/components/src/empty/index.tsexportsEmpty,TxEmpty,EmptyProps, andTxEmptyInstance.
查看源码
packages/tuffex/packages/components/src/empty/index.ts