Skip to main content

Empty

Empty state component. This component gives a message when some part or data is empty.

import { Empty } from "rizzui";

Default

The default style of the Empty.

No Data

import { Empty } from "rizzui";

export default function App() {
return (
<Empty
text="No Data"
textClassName="mt-2"
/>
);
}

No Product

You can use it if your product is Empty.

No Product Available

import { Empty, EmptyProductBoxIcon } from "rizzui";

export default function App() {
return (
<Empty
image={<EmptyProductBoxIcon />}
text="No Product Available"
/>
);
}

No Result Found

You can use it if your search is Empty.

No Result Found

import { Empty, SearchNotFoundIcon } from "rizzui";

export default function App() {
return (
<Empty
image={<SearchNotFoundIcon />}
text="No Result Found"
/>
);
}

API Reference


Empty Props

Here is the API documentation of the Empty component.

PropsTypeDescriptionDefault
textstringSet custom text message of the Empty component__
textClassNamestringSet custom classes for text style__
imageReactNodeAdd custom image or icon component__
imageClassNamestringAdd custom classes on to the image or icon component's wrapper__
defaultImageWidthstring numberSet custom width of the default image / icon184
defaultImageHeightstring numberSet custom height of the default image / icon152
defaultImageClassNamestringSet custom className of the default image / icon__
textTagEmptyTextTagsHere you can use your text tag"p"
alignmentEmptyAlignmentSet custom text message of the Empty component"center"
classNamestringAdd custom classes for extra style__

Empty Text Tags

type EmptyTextTags = "h2" | "h3" | "h4" | "h5" | "h6" | "p";

Empty Alignment

type EmptyAlignment = "center" | "inlineStart" | "inlineEnd";