Skip to content

Empty State ​

Empty states are messages that users see when there is no data or content to show.

Importing ​

To use the empty state component, first you need to register the component inside the page. You can register the component manually by importing the register function:

ts
import { register } from "@tapsioss/web-components/empty-state";

register(); // Now the empty state component is ready to use!
ts
import { registerEmptyState } from "@tapsioss/web-components";

registerEmptyState(); // Now the empty state component is ready to use!

Also you can automatically register the component by importing it with the following approach:

ts
import "@tapsioss/web-components/empty-state/element";

TIP

If you want to use all the component in your app, you can call registerAll at the root of your project.

ts
import { registerAll } from "@tapsioss/web-components";

registerAll(); // All the components are now available

In the React package, you can easily add the component using the following code:

ts
import { EmptyState } from "@tapsioss/react-components";

Component Usage ​

html
<tapsi-empty-state></tapsi-empty-state>
tsx
<EmptyState />

Properties ​

NameAttribute NameDescriptionTypeDefault Value
titletitleThe title of the empty state.string""
descriptiondescriptionThe description of the empty state.string""
contentAlignmentcontent-alignmentThe alignment of the content."center" | "auto""auto"

Slots ​

NameValueDescription
ICONiconThe slot for the action.
ACTIONactionThe slot for the action.

TIP

The value of slots are available for developer as JavaScript Variables:

ts
// Option 1
import { EmptyStateSlots } from "@tapsioss/web-components";

// Option 2
import { Slots } from "@tapsioss/web-components/empty-state";
ts
// Option 1
import { EmptyStateSlots } from "@tapsioss/react-components";

// Option 2
import { Slots } from "@tapsioss/react-components/EmptyState";

Created with 🧡