Save Bar

Shopify-style contextual save bar, shown when a form has unsaved changes. Renders nothing when not visible.

Selector: tip-save-bar

API

Name Type Default Description
visible (input) boolean false Typically bound to a page's dirty() computed signal; renders nothing when false.
message (input) string 'Unsaved changes' Left-aligned status text.
saving (input) boolean false Disables both buttons and swaps the Save label to "Saving…".
save (output) void Emitted on Save click.
discard (output) void Emitted on Discard click.

Usage

<tip-save-bar [visible]="dirty()" [saving]="saving()" (save)="onSave()" (discard)="onDiscard()" />
readonly dirty = computed(() => JSON.stringify(this.currentValues()) !== JSON.stringify(this.baseline()));
onSave(): void { this.baseline.set(this.currentValues()); this.toast.show('Settings saved', { tone: 'success' }); }
onDiscard(): void { this.applyValues(this.baseline()); }

Notes