Company
Printed on every invoice Northwind sends
Was “Northwind Traders Ltd”. Use the name on your Companies House record.
Was USD · US dollar. Applies from INV-1843.
A bar at the bottom of a form page that says what is unsaved and holds Discard and Save changes.
A save bar that sticks to the bottom of main: what is unsaved, when it was last saved, then Discard and Save changes.
Edit a field: it says Edited and the bar lists it. Clear the legal name and Save to see the error state.
Printed on every invoice Northwind sends
Was “Northwind Traders Ltd”. Use the name on your Companies House record.
Was USD · US dollar. Applies from INV-1843.
Put SaveBar last inside main, after the form, and set scroll-padding-bottom on the scroller to the bar height. Pass the changed field labels in changes and mark the same Fields with changed, old value in hint. Save is the page's one solid primary. On Save with field errors, set state error, say what to fix in message and focus an Alert summary (see Field). Leaving with changes opens AlertDialog in the app; closing the tab can only use the browser's own prompt.
A save bar that sticks to the bottom of main on a form page. It says what is unsaved ("2 unsaved changes" and the field names), when it was last saved, or what stopped the save, and holds Discard and Save changes. Save is the page's one solid primary.
import { SaveBar } from "agentic-ds-kit";From contracts/savebar.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| state | saved | dirty | error | No | dirty | saved: CircleCheck (icon.success), Discard hidden, Save disabled. dirty: CircleAlert (icon.warning). error: CircleX (icon.danger), status in status.dangerText, top edge status.dangerBorder. The icon is aria-hidden; the words carry the state. |
| changes | array | No | — | string[] of changed field labels, e.g. ["Legal name", "Invoice currency"]. The count makes the dirty status ("2 unsaved changes"); the names make the muted line under it. Mark the same fields with Field changed. |
| savedAt | string | No | — | Pre-formatted, e.g. "10:42" or "Nov 14 by Maya Chen". Saved reads "Saved at 10:42"; dirty and error add "last saved Nov 14 by Maya Chen" to the muted line. |
| message | string | No | — | The status line in your words; replaces the default ("2 unsaved changes", "Saved at 10:42", "Not saved"). In the error state say what to fix: "Not saved · 1 field to fix". Also the way to translate. |
| onDiscard | function | No | — | Renders an outline neutral Discard Button. Hidden in the saved state. Ask with AlertDialog first when discarding loses a lot. |
| onSave | function | Yes | — | The solid primary Save Button, disabled in the saved state. On Save with field errors, focus an Alert summary (see Field) and set state error. |
| saveLabel | string | No | Save changes | Also names the region. |
| discardLabel | string | No | Discard | Cancel when leaving the page is the outcome. |
| saving | boolean | No | false | Save shows its spinner (Button loading) and Discard is disabled while the request runs. |
Framed tile with optional header, body, and footer actions.
Dismissible overlay for short tasks, forms, or extra detail.
The panel chrome for a modal: one shared header (tone icon + eyebrow, Close, h2 title, description) and footer (footerStart left, actions right).
Immediate on/off setting.