import "capsomer/tokens.css";
import "capsomer/form-status.css";
import { FormStatus } from "capsomer/react/form-status";
Usage
<p tabindex="-1" role="alert" class="cap-alert cap-form-status" data-tone="crit">
<svg class="cap-status-glyph" aria-hidden="true">...</svg>
<span class="cap-alert-body">The title is empty. Write a title, then save again.</span>
</p>
import { FormStatus, useActionStatus } from "capsomer/react/form-status";
<FormStatus status={useActionStatus(actionData)} />
Examples
Saved
<div data-mount="ok" id="sample-ok"></div>
Before a post (empty, hidden, in the page)
<div data-mount="none" id="sample-none"></div>
API reference
FormStatus
Prop
Type
Required
Does
status
ActionStatus | null
Yes
The status to say, or null for none. A new object is a new result and takes focus.
focus
FormStatusFocus
className
string
Functions
Function
Signature
Does
useActionStatus
(data: unknown): ActionStatus | null
The status of the action's answer, read with actionStatus, kept stable while the answer is the same object so focus moves once per post: <FormStatus status={useActionStatus(actionData)} />.
Parts and data attributes
Class
Is
.cap-form-status
the root
Accessibility
Key
Does
Tab
From the result, on into the form
Focus lands on the result after each post; its words are its name.
Screen readers: no manual NVDA or VoiceOver run, by decision (2026-11-07); the automated browser checks and a front-end review stand in. Automated: see the site's Tests page.