Components/GuideState

GuideState

A state view that guides users through initial setup.

VerifiedSince 0.3.4

Usage

Basic

Use the preset title and description when the surrounding page already explains the context.

Loading demo...

Custom Copy

When the guide stands alone in a page or panel, override the copy and set surface="card".

Loading demo...

Best Practices

  • Use it for first use, setup prompts, or "start here" panels; use TxNoData for missing data.
  • Make the title name the next step, not describe an empty screen.
  • Use surface="card" among dashboard content; keep plain inside an already framed panel.
  • Keep action labels specific, such as "Create workspace" or "Connect account", not "Continue".
  • Pass slots only when the preset illustration or generated buttons cannot express the target action.

API Reference

Takes every TxEmptyState prop, event, and slot except variant, which is fixed to guide.

Props

PropTypeDefaultDescription
titlestring'Start here'Overrides the preset title.
descriptionstring'Follow the steps to get started.'Overrides the preset description.
iconTxIconSource | string | nullguide illustrationReplaces the illustration; null hides the icon area.
iconSizenumbersize presetIcon or spinner size in px.
layout'vertical' | 'horizontal''vertical'Layout direction.
align'start' | 'center' | 'end''center'Content alignment.
size'small' | 'medium' | 'large''medium'Visual size.
surface'plain' | 'card''plain'card adds a card surface.
primaryActionEmptyStateAction-Generated primary action; emits primary.
secondaryActionEmptyStateAction-Generated secondary action; emits secondary.
actionSizeTxButtonProps['size']'sm'Default size of the generated buttons.
loadingbooleanfalseShows a spinner when there is no icon slot or prop.

Events

EventPayloadDescription
primary()Fires when the generated primary button is clicked.
secondary()Fires when the generated secondary button is clicked.

Slots

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

Technologies

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