Autosave Draft Field
Draft editor with a blinking caret and a green saved stamp in its header that swaps for a spinning saving indicator the moment the field is touched.
- lines of CSS
- 93lines of CSS
- dependencies
- 0dependencies
- browser, for years
- Everybrowser, for years
- stops under reduced motion
- Guardedstops under reduced motion
Vue, Svelte, styled-components and Tailwind exports are part of Pro. HTML, CSS and React are free forever.
.fx-v14-fm-autosave-15836 {
width: 248px;
color: #cbd5e1;
}
.fx-v14-fm-autosave-15836 .hd {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.3rem;
font-size: 0.62rem;
color: #94a3b8;
}
.fx-v14-fm-autosave-15836 .st { position: relative; display: block; height: 12px; }
.fx-v14-fm-autosave-15836 .st em {
display: flex;
align-items: center;
gap: 0.28rem;
font-style: normal;
font-size: 0.56rem;
white-space: nowrap;
transition: opacity 0.2s ease;
}
.fx-v14-fm-autosave-15836 .st .b { position: absolute; right: 0; top: 0; opacity: 0; color: #7dd3fc; }
.fx-v14-fm-autosave-15836 .st .a { color: #6ee7b7; }
.fx-v14-fm-autosave-15836 .dt { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }
.fx-v14-fm-autosave-15836 .sp {
width: 8px;
height: 8px;
border: 1.5px solid rgba(125,211,252,0.3);
border-top-color: #7dd3fc;
border-radius: 50%;
animation: fx-v14-fm-autosave-15836-spin 0.7s linear infinite;
}
@keyframes fx-v14-fm-autosave-15836-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.fx-v14-fm-autosave-15836 .ta {
position: relative;
height: 66px;
padding: 0.4rem 0.5rem;
font-size: 0.66rem;
line-height: 1.45;
color: #cbd5e1;
background: #0d1424;
border: 1px solid #29344d;
border-radius: 0.4rem;
overflow: hidden;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.fx-v14-fm-autosave-15836 .cr {
display: inline-block;
width: 1.5px;
height: 11px;
margin-left: 1px;
vertical-align: -2px;
background: #7dd3fc;
animation: fx-v14-fm-autosave-15836-blink 1.1s steps(1, end) infinite;
}
@keyframes fx-v14-fm-autosave-15836-blink { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 1; } }
.fx-v14-fm-autosave-15836:hover .ta { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,0.14); }
.fx-v14-fm-autosave-15836:hover .st .a { opacity: 0; }
.fx-v14-fm-autosave-15836:hover .st .b { opacity: 1; }
.fx-v14-fm-autosave-15836 .ft {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 0.35rem;
}
.fx-v14-fm-autosave-15836 .ft em { font-style: normal; font-size: 0.55rem; color: #64748b; }
.fx-v14-fm-autosave-15836 .pb {
padding: 0.2rem 0.55rem;
font-size: 0.6rem;
font-weight: 600;
color: #082f49;
background: #38bdf8;
border-radius: 0.3rem;
cursor: pointer;
transition: background 0.18s ease;
}
.fx-v14-fm-autosave-15836 .pb:hover { background: #7dd3fc; }
@media (prefers-reduced-motion: reduce) {
.fx-v14-fm-autosave-15836,
.fx-v14-fm-autosave-15836::before,
.fx-v14-fm-autosave-15836::after,
.fx-v14-fm-autosave-15836 *,
.fx-v14-fm-autosave-15836 *::before,
.fx-v14-fm-autosave-15836 *::after {
animation-duration: 1ms !important;
animation-iteration-count: 1 !important;
animation-delay: 0ms !important;
transition-duration: 1ms !important;
transition-delay: 0ms !important;
}
}<div class="fx-v14-fm-autosave-15836">
<div class="hd">
<span>Release notes</span>
<span class="st">
<em class="a"><u class="dt"></u>Saved · 12s ago</em>
<em class="b"><u class="sp"></u>Saving…</em>
</span>
</div>
<div class="ta">Fixed the flicker on the pricing table and shortened the hover delay on nav items.<i class="cr"></i></div>
<div class="ft">
<em>Autosaves every 5 seconds</em>
<span class="pb">Publish</span>
</div>
</div>What do I do with this?
- Put
autosave-draft-field-15837.cssanywhere your page already loads CSS from — in Next.js that isapp/globals.css, or any stylesheet with a<link>in your HTML. - Then put the class on the element you want it on:
<button class="fx-v14-fm-autosave-15836">. The CSS does nothing until a class name in it matches something on the page.
- Link the stylesheet, then paste the markup wherever you need it.
npx hoverlab add autosave-draft-field-15837What's included
- The markup and the stylesheet, in whichever framework you pick
- No runtime dependencies
Works with
- React
- Vue
- Svelte
- Tailwind
- styled-components
- Plain CSS
npx hoverlab add autosave-draft-field-15837
Or over MCP, from your editor's agent — no account needed.
License
Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.
Motion safety
Static estimate, read from the CSS
- Reduced motion
- Guarded
Ships a
prefers-reduced-motionblock, so the loop settles into its end state for visitors who ask for less motion. - What it animates
- Repaints
Animates
background,border-color,box-shadow. No reflow, but the browser repaints every frame, which is fine for one element and costly across many. - Flashing (WCAG 2.3.1)
- Under 3 flashes/s
Its brightest loop is about 0.9 a second. Estimated from duration, iterations and keyframes, not from rendered frames.
- Layout shift (CLS)
- No shift expected
Nothing it animates moves or resizes the box in flow. A category from the CSS, not a measurement for this effect.
Every row is read from the shipped CSS. Only a figure marked measured came from a browser. Customizing the speed changes the timing, so recheck a customized copy. How it is computed
33 more effects in Forms & Validation
All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.
Browse Forms & ValidationShipping one commercially
Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
- A commercial licence for everything in the catalog
- Unlimited bundle exports, in Vue, Svelte and Tailwind
- One payment — no subscription, nothing to renew
7 variations of Autosave Draft Field
Finished looks, each one a position in the customizer above. Copy any of them, or open it and keep moving the sliders.