BlankSlate
Large onboarding empty state for first-use screens and empty product areas.
Usage
BlankSlate
Loading demo...
Best Practices
- Use it for first-use or onboarding states; use
TxNoDatafor recurring empty query results. - Explain the value of the first action, not just the absence of content.
- Keep the primary action singular and direct. Secondary actions should teach, import, or dismiss.
- Avoid
surface="card"on full-page blank slates unless the surrounding layout already uses card containment.
API Reference
Props
TxBlankSlate accepts every EmptyStateProps field except variant.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | preset title | Onboarding headline. |
description | string | preset description | Explains why the first action matters. |
icon | TxIconSource | string | null | preset illustration | Custom icon source/class, or null to hide the icon area. |
iconSize | number | size preset | Custom icon size in pixels. |
layout | 'vertical' | 'horizontal' | 'vertical' | Empty-state layout. |
align | 'start' | 'center' | 'end' | 'center' | Alignment within the wrapper. |
size | 'small' | 'medium' | 'large' | 'large' | Density and illustration scale. |
surface | 'plain' | 'card' | 'plain' | Adds card containment when needed. |
primaryAction | EmptyStateAction | - | Generated primary action. |
secondaryAction | EmptyStateAction | - | Generated secondary action. |
actionSize | TxButtonProps['size'] | 'small' | Default generated action size. |
loading | boolean | false | Uses spinner when no custom icon is supplied. |
Events
| Event | Params | Description |
|---|---|---|
primary | - | Forwarded from the generated primary action. |
secondary | - | Forwarded from the generated secondary action. |
Slots
| Slot | Props | Description |
|---|---|---|
icon | - | Replaces the preset illustration or custom icon. |
title | - | Replaces resolved title content. |
description | - | Replaces resolved description content. |
actions | - | Replaces generated primary/secondary action buttons. |
Overview
- Always forwards
variant="blank-slate"toTxEmptyState. - Applies onboarding defaults:
size="large",layout="vertical", andsurface="plain". - Explicit
size,layout, andsurfaceprops override those defaults. - Forwards
icon,title,description, andactionsslots unchanged toTxEmptyState. - Generated
primary/secondaryevents come from the wrappedTxEmptyStateaction buttons.
Technologies
- Reviewed against
packages/tuffex/packages/components/src/blank-slate/src/TxBlankSlate.vue,types.ts, andblank-slate.test.ts. - Verified coverage:
blank-slate.test.tscovers fixedvariant="blank-slate", onboarding defaults, explicit layout overrides, named slot forwarding, and install registration. - Accessibility note:
TxBlankSlatedelegates semantics toTxEmptyState; keep first-action copy specific and avoid placing multiple competing calls to action inactions. - Component source:
packages/tuffex/packages/components/src/blank-slate/src/TxBlankSlate.vue. - Types:
packages/tuffex/packages/components/src/blank-slate/src/types.tsexportsBlankSlatePropsasOmit<EmptyStateProps, 'variant'>. - Coverage:
packages/tuffex/packages/components/src/blank-slate/__tests__/blank-slate.test.tsverifies wrapper defaults, overrides, slot forwarding, and install registration.查看源码packages/tuffex/packages/components/src/blank-slate/index.ts