Examples
Status and feedback
Distinguish lifecycle badges from persistent page-level feedback.
Public contracts
NxAlertNxButtonNxLoadingBlockNxMissingRequiredReferencesAlertNxModalDialogNxStatusBadgeLive preview
LiveLifecycle badges
Compact state markers for rows and metadata.
NxStatusBadgePersistent alert
Page-level feedback with an explicit severity.
NxAlertIntegration offline
Missing references
A recoverable prerequisite with an App-owned creation action.
NxMissingRequiredReferencesAlertRequired reference data is missing
Loading placeholder
Content-shaped progress while a query is pending.
NxLoadingBlockModal confirmation
An action opens this dialog; it is not combined with the other states.
NxModalDialogCopyable source
Code example
TSX
import { useState } from "react";
import {
NxAlert,
NxButton,
NxLoadingBlock,
NxMissingRequiredReferencesAlert,
NxModalDialog,
NxStatusBadge,
} from "@nexia/sdk/host";
export function StatusAndFeedbackExample() {
const [dialogOpen, setDialogOpen] = useState(false);
return (
<div className="grid gap-6">
<div className="flex flex-wrap gap-2">
<NxStatusBadge variant="success">Active</NxStatusBadge>
<NxStatusBadge variant="warning">Pending</NxStatusBadge>
<NxStatusBadge variant="error">Failed</NxStatusBadge>
</div>
<NxAlert variant="warning" title="Integration offline">
New records will be queued until the connection returns.
</NxAlert>
<NxMissingRequiredReferencesAlert
title="Required reference data is missing"
items={[
{
key: "plant",
label: "Plant",
createLabel: "Create plant",
onCreate: () => undefined,
},
]}
/>
<NxLoadingBlock shape="text" lines={3} label="Loading records" />
<NxButton variant="secondary" onClick={() => setDialogOpen(true)}>
Open dialog
</NxButton>
<NxModalDialog
open={dialogOpen}
onClose={() => setDialogOpen(false)}
title="Archive record"
description="The record remains available in history."
footer={
<NxButton onClick={() => setDialogOpen(false)}>
Confirm
</NxButton>
}
>
Review the record before continuing.
</NxModalDialog>
</div>
);
}