Navigated to /docs/ui/components/empty-state

EmptyState

Empty, error, or onboarding state composition.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { EmptyState } from "@tavojs/ui/empty-state";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/empty-state.

When to use

Use it when

Use `EmptyState` for empty lists, empty search results, and first-run screens

Choose something else when

Avoid EmptyState when using feedback components as primary page layout.

Examples

EmptyState example

TSX
tsximport { EmptyState } from "@tavojs/ui/empty-state";
import { Button } from "@tavojs/ui";

export function EmptyStateExample1() {
  return (
    <>
      <EmptyState title="No files" description="Upload a file to get started." actions={<Button>Upload</Button>} />
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
iconChild

Configures icon for this component.
titleChild

Configures title for this component.
descriptionChild

Configures description for this component.
actionsChild

Configures actions for this component.

Complete TypeScript API

Import from @tavojs/ui/empty-state. Published exports: EmptyState, EmptyStateProps.

EmptyStateProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by EmptyState.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by EmptyState.

idstring

No

Inherited id attribute accepted by EmptyState.

rolestring

No

Inherited role attribute accepted by EmptyState.

styleRecord<string, unknown>

No

Inherited style attribute accepted by EmptyState.

titlestring & Child

No

Configures title for this component.

tabIndexnumber

No

Inherited tabIndex attribute accepted by EmptyState.

hiddenboolean

No

Inherited hidden attribute accepted by EmptyState.

disabledboolean

No

Inherited disabled attribute accepted by EmptyState.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by EmptyState.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by EmptyState.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by EmptyState.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by EmptyState.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by EmptyState.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by EmptyState.

iconChild

No

Configures icon for this component.

descriptionChild

No

Configures description for this component.

actionsChild

No

Configures actions for this component.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetPublic passthrough props target the component root. Treat nested elements and private class names as implementation details.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid EmptyState when using feedback components as primary page layout.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Feedback components should announce status changes and manage focus only when the component owns that behavior.

  • Use Dialog, Sheet, or FocusTrap for modal workflows.

  • Use Toast or native live-region semantics for dynamic announcements.

  • Make dismiss and escape behavior clear for overlays.

Component status

ContractCurrent value
Maturitystable
Categoryfeedback
Component import@tavojs/ui/empty-state
Explicit CSS import@tavojs/ui/css/empty-state
PreviewInteractive preview available on this page