Skip to main content

Forms

Enable automatic save bar integration for HTML forms by adding the data-save-bar attribute to your form element. When form data changes, a save bar automatically appears, prompting users to save or discard their changes.

Alternatively, use the global shopify.saveBar API for programmatic control over the save bar behavior. Programmatic control of the save bar is available as shopify.saveBar.show(), shopify.saveBar.hide(), and shopify.saveBar.toggle().

Note: The save bar functionality requires the full App Bridge UI library to be loaded via a script tag.

Anchor to enable save bar on formsEnable save bar on forms

Simply add data-save-bar to your <form> element:

<form data-save-bar>
  <!-- Your form fields -->
</form>
Anchor to data-discard-confirmation
data-discard-confirmation
boolean
Anchor to data-save-bar
data-save-bar
boolean
Anchor to onreset
onreset
(event: Event) => void
Anchor to onsubmit
onsubmit
(event: SubmitEvent) => void
Examples
<form data-save-bar>
<s-text-field
label="Product Title"
name="title"
required
></s-text-field>

<s-text-area
label="Description"
name="description"
rows="4"
></s-text-area>

<s-text-field
label="Price"
name="price"
type="number"
step="0.01"
min="0"
></s-text-field>
</form>

Preview

Was this page helpful?