States
Placeholders for loading, empty and failed content.
import { Loading, Empty, ErrorState } from '@iffday/ui';Example
From the top: Loading is a blinking red dot with Loading…; Empty is a dashed box that says why the place is empty and what the reader can do; ErrorState is pale red with the reason, plus a Retry button when retry is passed.
Loading…
This list has no films yet
The server has not confirmed this save. Keep the form and retry; the same operation ID will be checked.
import { useT } from '@iffday/i18n';
import { Button, Empty, ErrorState, Loading } from '@iffday/ui';
export default function Example() {
const t = useT();
return (
<div style={{ display: 'grid', gap: 4, width: 'min(100%, 520px)' }}>
<Loading />
<Empty
title={t('list.thisListHasNoFilmsYet')}
action={
<Button type="button" className="button small">
{t('common.add')}
</Button>
}
/>
<ErrorState error="error.theServerHasNotConfirmedThisSaveKeepThe" retry={() => {}} />
</div>
);
}Usage
- The
errorofErrorStatecan be a message key, translated for the reader, or text that is already translated. - An empty state’s title states the fact (This list has no films yet); the description gives the next step, with one button at most.
- With reduced motion set in the system, the loading dot does not blink.
Props
No props.
- src/pages/cms-festivals.tsx7
- src/pages/editorial.tsx7
- src/pages/cms.tsx5
- src/pages/personal.tsx5
- src/pages/festivals.tsx4
- src/pages/profile.tsx4
- src/pages/cms-addresses.tsx3
- src/pages/film-entry.tsx3
- src/pages/search.tsx3
- src/pages/social.tsx3
- src/pages/community.tsx2
- src/pages/feed.tsx2
- src/pages/festival-directory.tsx2
- src/pages/film-images.tsx2
- src/pages/general-movie.tsx2
- src/pages/screening.tsx2
- src/pages/wallet-extras.tsx2
- src/App.tsx1
- src/pages/cms-film-reviews.tsx1
- src/pages/cms-translations.tsx1
- src/pages/follows.tsx1
- src/pages/list-page.tsx1
- src/pages/person.tsx1
- src/pages/plan-page.tsx1
- src/pages/programme.tsx1
- src/pages/schedule.tsx1
| Prop | Type | Default |
|---|---|---|
title* | string | |
description | string | |
action | ReactNode |
- src/pages/festivals.tsx7
- src/pages/personal.tsx7
- src/pages/cms.tsx4
- src/pages/editorial.tsx4
- src/pages/social.tsx4
- src/pages/feed.tsx3
- src/pages/community.tsx2
- src/pages/festival-directory.tsx2
- src/pages/search.tsx2
- src/owner-route.tsx1
- src/pages/cms-addresses.tsx1
- src/pages/cms-festivals.tsx1
- src/pages/cms-film-reviews.tsx1
- src/pages/cms-translations.tsx1
- src/pages/film-entry.tsx1
- src/pages/follows.tsx1
- src/pages/general-movie.tsx1
- src/pages/list-page.tsx1
- src/pages/plan-page.tsx1
- src/pages/programme.tsx1
- src/pages/schedule.tsx1
ErrorState
packages/ui/src/layout.tsx:59| Prop | Type | Default |
|---|---|---|
error* | string | |
retry | () => void |
- src/pages/cms.tsx10
- src/pages/cms-festivals.tsx7
- src/pages/editorial.tsx7
- src/pages/personal.tsx6
- src/pages/festivals.tsx5
- src/pages/profile.tsx5
- src/pages/social.tsx5
- src/pages/film-entry.tsx4
- src/pages/general-movie.tsx3
- src/pages/programme.tsx3
- src/pages/search.tsx3
- src/pages/cms-addresses.tsx2
- src/pages/community.tsx2
- src/pages/festival-directory.tsx2
- src/pages/film-images.tsx2
- src/pages/screening.tsx2
- src/pages/wallet-extras.tsx2
- src/App.tsx1
- src/pages/archive-tools.tsx1
- src/pages/catalog-drafts.tsx1
- src/pages/cms-film-reviews.tsx1
- src/pages/cms-translations.tsx1
- src/pages/feed.tsx1
- src/pages/follows.tsx1
- src/pages/list-page.tsx1
- src/pages/person.tsx1
- src/pages/plan-page.tsx1
- src/pages/planner-settings.tsx1
- src/pages/schedule.tsx1
- src/pages/sticker-board.tsx1