Icon Message is a component that can be used to show a message with an icon in the center of the page.
size
medium
small
, medium
, large
.icon
null
message
null
iconColor
null
iconSize
null
padding
null
empty
false
error
false
<IconMessage empty size="small" />
<IconMessage empty size="medium" />
<IconMessage empty size="large" />
You can use custom icons and messages with Icon Message, as well as custom padding, colors, and sizes.
<IconMessage
icon={IconSearch}
iconColor="var(--accent-dark)"
padding={20}
iconSize={50}
>
Nothing to search here
</IconMessage>
Icon Message has two templates: empty
and error
. You can use them by
setting empty
or error
prop to true
.
<IconMessage error />
<IconMessage empty />
<IconMessage iconColor="var(--green)">
<div>
There are no results to show.
</div>
<IconInbox slot="icon" size={60} />
</IconMessage>
You can add a call to action button using the cta
prop.
<IconMessage
error
cta={{
text: "Try again",
onClick: (e) => {
toast.info("Trying again...");
},
props: { color: "red" },
}}
/>
For custom UIs, you can use the cta
slot.