Components
Empty state
Stands in for a view’s content when there is none, or when it could not load.
No applications yet
When you apply for a role, it shows here with where it has got to.
import { EmptyState } from '@dex/shared/components/empty-state'
export function EmptyStateDefault() {
return (
<EmptyState
title="No applications yet"
description="When you apply for a role, it shows here with where it has got to."
/>
)
}
No roles match these filters
Clear a filter to see more roles.
import { SearchX } from 'lucide-react'
import { EmptyState } from '@dex/shared/components/empty-state'
export function EmptyStateWithIcon() {
return (
<EmptyState
icon={SearchX}
title="No roles match these filters"
description="Clear a filter to see more roles."
/>
)
}
We couldn't load your matches
Check your connection, then try again.
'use client'
import { CircleAlert } from 'lucide-react'
import { Button } from '@dex/shared/components/button'
import { EmptyState } from '@dex/shared/components/empty-state'
export function EmptyStateWithAction() {
return (
<EmptyState
icon={CircleAlert}
tone="danger"
title="We couldn't load your matches"
description="Check your connection, then try again."
action={<Button>Try again</Button>}
/>
)
}
No pending matches
Type at least 2 characters to search.
import { EmptyState } from '@dex/shared/components/empty-state'
// The card stands in for a pane, such as a side rail or a tab.
export function EmptyStateSmall() {
return (
<div className="flex w-full max-w-sm flex-col gap-3">
<div className="rounded-lg bg-card shadow-sm">
<EmptyState size="sm" title="No pending matches" />
</div>
<div className="rounded-lg bg-card shadow-sm">
<EmptyState size="sm" description="Type at least 2 characters to search." />
</div>
</div>
)
}
- It sits on the surface its content would be on, with no card of its own. Give it a height, or
flex-1, to centre it down the space. - The title says what is missing, in sentence case with no full stop: "No applications yet". The description is one or two plain sentences on why, or what to do.
- Use
size="sm"in a pane, a tab, a side rail or a dialog, and the default for a whole view. - An icon only where it adds meaning, standing on its own in muted grey. Never put it in a circle.
- A view that failed to load is the same component:
tone="danger"on the icon, and one action that tries again. - A one-line note, such as "Type at least 2 characters to search", is a description with no title.