SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

saveBarSync

Why JS.

tsx
import { saveBarSync } from "@sdxc/ui/app";

Usage

Applied to the bar ([data-slot="save-bar"]): unhides it while the form's values differ from their baseline, which a submission moves to the submitted values, and ⌘S saves them unless the form's own primary save answers it. [role="status"] announces message.

Signature

typescript
saveBarSync(options: SaveBarSync.Options): MixinDescriptor<HTMLElement>

Parameters

ParameterTypeRequiredDescription
optionsSaveBarSync.OptionsYes

Examples

tsx
<div hidden mix={[saveBarSync({ message: "Unsaved changes" })]}>…</div>

The events, constants and types its module publishes, each imported from @sdxc/ui/app too.

Interface

SaveBarSync.Options

Configuration for saveBarSync.

MemberTypeRequiredDescription
formstringNoThe id of the watched form; omit when the bar sits inside it.
messagestringYesWhat the bar's live region announces once the form changes, such as "Unsaved changes".
@sdxc/ui

Can’t find it? Contact us