Skip to content

Examples

Empty states

Compare permission, first-use, no-results, not-found, and error states independently.

Public contractsNxButtonNxEmptyView

Live preview

Live

Permission denied

kind="permission"

NxEmptyView
Permission denied
The current actor cannot open this content.

No records yet

kind="empty"

NxEmptyView
No records yet
Create the first record to start this workflow.

No matching records

kind="noResults"

NxEmptyView
No matching records
Change the filters and try again.

Record not found

kind="notFound"

NxEmptyView
Record not found
It may have moved or been removed.

Could not load records

kind="error"

NxEmptyView
Could not load records
Retry after checking the connection.

Copyable source

Code example
TSX
import { NxButton, NxEmptyView } from "@nexia/sdk/host";

export function EmptyStatesExample() {
    return (
        <div className="grid gap-5 lg:grid-cols-2">
            <NxEmptyView
                kind="permission"
                title="Permission denied"
                description="The current actor cannot open this content."
            />
            <NxEmptyView
                kind="empty"
                title="No records yet"
                description="Create the first record to start this workflow."
            >
                <NxButton size="sm">Create record</NxButton>
            </NxEmptyView>
            <NxEmptyView
                kind="noResults"
                title="No matching records"
                description="Change the filters and try again."
            />
            <NxEmptyView
                kind="notFound"
                title="Record not found"
                description="It may have moved or been removed."
            />
            <NxEmptyView
                kind="error"
                title="Could not load records"
                description="Retry after checking the connection."
            >
                <NxButton size="sm" variant="secondary">
                    Retry
                </NxButton>
            </NxEmptyView>
        </div>
    );
}