Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
EmptyState

Represents the component's empty state while the main content is loading.

The EmptyState can be used to represent an empty state.
Example
Code

Your Cart is empty

Nothing matches with your search


Usage

Import the component


_10
import { EmptyState } from "@faststore/ui";

Import styles

To apply styles, include the following in your stylesheet:

_10
@import "@faststore/ui/src/components/organisms/EmptyState/styles.scss";


Design tokens

Local tokenDefault value/Global token linked
--fs-empty-state-height100%
--fs-empty-state-min-height50vh
--fs-empty-state-padding0 var(--fs-spacing-8)

Design tokens: Title

Local tokenDefault value/Global token linked
--fs-empty-state-title-margin-bottomvar(--fs-spacing-2)
--fs-empty-state-title-color
var(--fs-color-disabled-text)
--fs-empty-state-title-sizevar(--fs-text-size-lead)
Local tokenDefault value/Global token linked
--fs-empty-state-link-min-width11.875rem

Design tokens: Rounded

Local tokenDefault value/Global token linked
--fs-empty-state-border-radiusvar(--fs-border-radius)

Design tokens: Default background color

Local tokenDefault value/Global token linked
--fs-empty-state-bkg-color-defaultvar(--fs-color-neutral-bkg)

Design tokens: White background color

Local tokenDefault value/Global token linked
--fs-empty-state-bkg-color-lightvar(--fs-color-body-bkg)

Data attributes

You can target and override EmptyState styles using the following data attributes:
data-fs-empty-state
data-fs-empty-state-title
data-fs-empty-state-variant="default | rounded"
data-fs-empty-state-bkg-color="default | white"

Props

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-empty-state
titlestringThe EmptyState component's title.
titleIconstring | number | false | true | {} | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortalA React component that will be rendered as an icon on the Title.
variant"default" | "rounded"Specifies the component border variant.default
bkgColor"default" | "light"Specifies the component background color.default
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
On this page