Components/BlankSlate

BlankSlate

A large empty state that guides first-time users to a first action.

VerifiedSince 0.3.4

Usage

Basic

Loading demo...

Best Practices

  • Use it for first use and onboarding; use TxNoData for recurring empty query results.
  • Explain the value of the first step, not just the absence of content.
  • Offer one direct primary action; secondary actions teach, import, or skip.
  • Keep full-page blank slates on surface="plain" unless the layout already uses cards.

API Reference

Takes every TxEmptyState prop, event, and slot except variant, which is fixed to blank-slate; size defaults to 'large'.

Props

PropTypeDefaultDescription
titlestringpreset titleOnboarding headline.
descriptionstringpreset descriptionWhy the first step matters.
iconTxIconSource | string | nullpreset illustrationReplaces the illustration; null hides the icon area.
iconSizenumbersize presetIcon size in px.
layout'vertical' | 'horizontal''vertical'Layout direction.
align'start' | 'center' | 'end''center'Content alignment.
size'small' | 'medium' | 'large''large'Spacing and illustration size.
surface'plain' | 'card''plain'card adds a card border.
primaryActionEmptyStateAction-Generated primary action.
secondaryActionEmptyStateAction-Generated secondary action.
actionSizeTxButtonProps['size']'sm'Default size of the generated buttons.
loadingbooleanfalseShows a spinner when no custom icon is given.

Events

EventParamsDescription
primary-Fires when the generated primary action is clicked.
secondary-Fires when the generated secondary action is clicked.

Slots

SlotPropsDescription
icon-Replaces the illustration or icon.
title-Replaces the title.
description-Replaces the description.
actions-Replaces the generated primary and secondary buttons.

Technologies

  • Source: packages/tuffex/packages/components/src/blank-slate/.
查看源码
packages/tuffex/packages/components/src/blank-slate/index.ts