save-button-placement

Enforce SaveButton placement and dirty-tracking in React editing workflows.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Norfolk-Group/H-Analytics --skill save-button-placement
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: save-button-placement
Source: https://github.com/Norfolk-Group/H-Analytics/tree/main/.claude/archive/agents-skills-snapshot/save-button-placement
Command: npx skills add https://github.com/Norfolk-Group/H-Analytics --skill save-button-placement

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent placement and behavior of Save Changes controls leads to user confusion, accidental navigation away from unsaved edits, and duplicated or missing submission flows; this guidance defines a single SaveButton API, placement patterns, dirty-tracking flow, and dialog exceptions to eliminate those issues.

Core Features & Use Cases

  • Standardized SaveButton component contract with props for onClick, isPending, hasChanges, disabled, type, size, and test identifier to ensure consistent behavior and testability.
  • Three placement patterns: PageHeader actions for primary saves, bottom-of-form mirrors paired with PageHeader saves for long forms, and tab/section-level saves for isolated sections, with examples referenced for each pattern.
  • Dirty-tracking flow using a local draft state compared to last-saved data, an isDirty / hasChanges flag, a beforeunload navigation warning, and mutation handling via TanStack Query to manage isPending and reset state on success.
  • Dialog exception that uses standard DialogFooter buttons rather than the SaveButton to accommodate modal UX constraints.
  • Practical examples include property edit pages, company assumptions pages, and admin settings tabs where each pattern and the dirty-tracking flow are demonstrated.

Quick Start

Place the SaveButton in the PageHeader actions, maintain a local draft and isDirty flag passed to hasChanges, and trigger a TanStack Query mutation while passing mutation.isPending to isPending.

Frequently Asked Questions about save-button-placement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement consistent Save Changes button placement in a React UI?▼

Consistent Save Changes button placement uses a standardized SaveButton component in PageHeader actions, bottom-of-form mirrors, and tab-level section saves to eliminate user confusion and duplicated submission flows across React frontend editing workflows.

How do I track unsaved form changes to prevent accidental navigation in React?▼

Track unsaved form changes by maintaining a local draft state compared to last-saved data, computing an isDirty flag, and triggering a beforeunload navigation warning to prevent accidental data loss during React editing sessions.

How do I manage Save button pending state with TanStack Query mutations?▼

Manage Save button pending state by passing TanStack Query mutation.isPending to the SaveButton isPending prop, allowing the component to disable interactions and reset local draft state upon successful mutation completion.

Can I use the standard SaveButton component inside a React dialog footer?▼

Dialog footers use standard DialogFooter buttons rather than the SaveButton component to accommodate modal UX constraints, providing an exception to the standard page-level save placement patterns.

What is the best way to handle long forms with both header and bottom save buttons in React?▼

Long forms handle dual save buttons by pairing a primary PageHeader save action with a bottom-of-form mirror, both utilizing the same SaveButton API and local draft dirty-tracking to ensure synchronized submission behavior.

What props are required for a standardized React SaveButton component contract?▼

A standardized SaveButton component contract requires props for onClick, isPending, hasChanges, disabled, type, size, and a test identifier to ensure consistent behavior and testability across React editing workflows.