Sticky, with another action and Save not yet usable
<div class="cap-save-bar" data-sticky="">
<p role="status" class="cap-save-bar-status"></p>
<button type="button" class="cap-btn">Check</button>
<button type="submit" class="cap-btn" data-variant="primary" aria-disabled="true" aria-describedby="why-save">Save changes</button>
<span class="cap-btn-reason" id="why-save">Turn on disputes to save these settings.</span>
</div>
API reference
SaveBar
Prop
Type
Required
Does
pending
boolean
A save in flight: the button shows its spinner; with no button the region says "Saving…".
saved
ReactNode
The last save worked: true says "Saved"; words say those instead ("Saved.").
error
ReactNode
The last save failed, in words: "Failed to save. Please try again."
submit
ReactNode
The button's words.
button
boolean
False leaves the button out: a form with nothing to save yet, or one that saves as each control changes, where the bar only says what happened. The status region stays.
children
ReactNode
Another action before Save (Check, Cancel, Reset).
disabledReason
ReactNode
Why Save cannot be used yet (a feature that is off): the button stays, aria-disabled, and says why (button.md).
sticky
boolean
The bar stays on the window's bottom edge while a long form scrolls.
form
string
The form the button submits, when the bar sits outside it.
name
string
The button's name and value, for a form with several actions posting to one route.
value
string
className
string
Parts and data attributes
Class
Is
.cap-save-bar
the root
.cap-save-bar-status
a part
Attribute
Values
data-sticky
present or absent
Accessibility
Key
Does
Tab
Reaches the button after the form's fields
Enter in a field
Posts the form
role="status" is polite: the result is read after what the reader is saying.
The result carries its glyph as well as its color (the status component).
The button keeps its words while saving and shows the spinner (aria-busy).