Components/EmptyState
Since 1.0.0BETA

EmptyState

Feedback component for empty, loading, error, offline, and setup states.

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

EmptyState

TxEmptyState renders a compact feedback panel for pages, tables, detail panes, and onboarding steps that do not have content to show yet. Use a preset variant for common states, then override the text, icon, or actions only when the local context needs more specific copy.

Basic Usage

EmptyState (variant)

Demo will load when visible.
<template>
  <TxEmptyState
    variant="no-data"
    :primary-action="{ label: 'Create', type: 'primary' }"
    :secondary-action="{ label: 'Refresh' }"
  />
</template>

Horizontal Layout

EmptyState (horizontal)

Demo will load when visible.
<template>
  <TxEmptyState
    variant="no-selection"
    layout="horizontal"
    surface="card"
    title="No selection"
    description="Pick an item from the left to continue."
  />
</template>

Custom Slots

EmptyState (slots)

Demo will load when visible.
<template>
  <TxEmptyState variant="custom">
    <template #icon>
      <TxIcon name="i-carbon-search" :size="28" />
    </template>
    <template #title>
      Setup required
    </template>
    <template #description>
      Connect a workspace to enable this feature.
    </template>
    <template #actions>
      <TxButton type="primary">Connect</TxButton>
      <TxButton>Learn more</TxButton>
    </template>
  </TxEmptyState>
</template>

Preset Components

  • TxBlankSlate: large blank state (default size="large")
  • TxLoadingState: loading placeholder (default variant="loading")
  • TxNoSelection: no-selection placeholder (default variant="no-selection")
  • TxNoData: no-data placeholder (default variant="no-data")
  • TxSearchEmpty: empty search state (default variant="search-empty")
  • TxOfflineState: offline hint (default variant="offline")
  • TxPermissionState: permission denied (default variant="permission")
  • TxErrorState: error state (default variant="error"), see ErrorState
  • TxGuideState: guide state (default variant="guide"), see GuideState

API

Props

PropTypeDefaultDescription
variantEmptyStateVariant'empty'Selects the preset title, description, and illustration for common states.
titlestring-Overrides the preset title.
descriptionstring-Overrides the preset supporting text.
iconTxIconSource | string | null-Replaces the preset illustration with a Tuff icon source, icon class/name, or null to hide the icon area.
iconSizenumber-Sets the custom icon or spinner size in pixels; presets use the size scale when omitted.
layout'vertical' | 'horizontal''vertical'Controls whether icon and content stack vertically or sit side by side.
align'start' | 'center' | 'end''center'Aligns the icon, copy, and actions within the empty-state panel.
size'small' | 'medium' | 'large''medium'Adjusts spacing, text scale, and preset illustration size.
surface'plain' | 'card''plain'Adds a bordered card surface when the empty state needs visual containment.
primaryActionEmptyStateAction-Renders the primary action button and emits primary when clicked.
secondaryActionEmptyStateAction-Renders the secondary action button before the primary action and emits secondary when clicked.
actionSizeTxButtonProps['size']'small'Default button size used by actions that do not set their own size.
loadingbooleanfalseShows a spinner when no custom icon slot or icon prop is provided.

EmptyStateAction

PropTypeDefaultDescription
labelstring-Button text.
typeTxButtonProps['type']-Button tone shortcut forwarded to TxButton.
variantTxButtonProps['variant']-Explicit TxButton visual variant.
sizeTxButtonProps['size']-Per-action size override.
disabledbooleanfalseDisables the action button and suppresses its event.
iconstring-Optional icon class rendered inside the action button.

Slots

NameDescription
iconReplaces the preset illustration, spinner, or icon prop.
titleReplaces the resolved title content.
descriptionReplaces the resolved description content.
actionsReplaces generated primary and secondary action buttons.

Events

EventDescription
primaryEmitted when the generated primary action button is clicked.
secondaryEmitted when the generated secondary action button is clicked.