Examples
End-of-flow outcomes
Use a clear result for a completed workflow, with a concise explanation and optional next action.
Workspace created
Your team can now add members and projects.
Import failed
Check the file format and correct the listed errors before trying again.
Project not found
The link may be out of date, or you may not have access.
Success, error, and not-found results
import { Button } from "@phuctech/ui/components/button";
import { Result } from "@phuctech/ui/components/result";
export function Example() {
return (
<div className="grid w-full gap-2 divide-y divide-border rounded-xl border border-border bg-card">
<Result status="success" heading="Workspace created" description="Your team can now add members and projects." action={<Button type="button">Open workspace</Button>} />
<Result status="error" heading="Import failed" description="Check the file format and correct the listed errors before trying again." action={<Button type="button" variant="outline">Review file</Button>} />
<Result status="not-found" heading="Project not found" description="The link may be out of date, or you may not have access." />
</div>
);
}
Try the props
Compare outcome semantics and an optional next action.
Workspace created
Your team can now add members and projects.
Result property playground
import { Result } from "@phuctech/ui/components/result";
import { Button } from "@phuctech/ui/components/button";
export function Example() {
return <Result status="success" heading="Workspace created" description="Your team can now add members and projects." action={<Button type="button">Continue</Button>} />;
}When to use
Use Result for a completed success, failure, or not-found state that deserves a focused explanation. For an inline issue, use Alert; for a transient message, use Toast.
Usage
import { Result } from "@phuctech/ui/components/result";
<Result status="success" heading="Workspace created" description="Your team can now add projects." />API
Tokens
Accessibility
Result is a named region whose heading is rendered at level two, so it can sit beneath the page heading or alongside other results. Its icon is hidden from assistive technology; all meaning remains in text.
Do and don’t
Give people a clear outcome and a relevant way forward.
Replace an actionable field error or a transient status with a full result screen.
Related
- Alert is inline, persistent feedback.
- Toast is non-blocking transient feedback.
- EmptyState explains a collection with no content.