Skip to content

Empty state

import { EmptyState } from '@yarcl/react';

No matching projects

Try changing or clearing your filters.

<EmptyState
icon={<SearchIcon />}
title="No matching projects"
description="Try changing or clearing your filters."
actions={<Button variant="outline">Clear filters</Button>}
/>

gap, padding, color and textStyle use keys from your config and can be set in components.EmptyState. The icon is decorative and receives color; the description receives textStyle.

The title is a semantic heading. Set headingLevel to fit the surrounding page outline. Empty states are static content and do not announce themselves as live regions. Add a live region separately when an empty state appears in response to an asynchronous action and needs an announcement.

Spacing props accept typed breakpoint maps. See responsive props for supported props, defaults and examples.

PropTypeDefaultDescription
title requiredReactNodeMain message.
actionsReactNodeActions shown below the description, usually buttons or links.
colorColorconfigconfig.defaults.colorIcon color, from the colors config.
descriptionReactNodeSupporting text below the title.
gapResponsive<Spacing>configconfig.defaults.gapSpace between content, from the spacing config. Accepts a scalar or breakpoint map.
headingLevel3 | 2 | 4 | 1 | 5 | 62Semantic heading level for the title.
iconReactNodeDecorative content shown above the title.
paddingResponsive<Spacing>configconfig.defaults.paddingInner spacing, from the spacing config. Accepts a scalar or breakpoint map.
textStyleTextStyleconfigconfig.defaults.textStyleDescription typography, from the typography.styles config.