A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX)

title: “A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX)”
published: true
tags: wordpress, accessibility, performance, ux
series: “Micro UX That Respects Users”

canonical_url: “https://vibeaxis.com/Ai-tools/

description: “A t…


This content originally appeared on DEV Community and was authored by Jason Bann

title: "A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX)"
published: true
tags: wordpress, accessibility, performance, ux
series: "Micro UX That Respects Users"

canonical_url: "https://vibeaxis.com/Ai-tools/

description: "A tiny ‘Back to Top’ that ships zero JS, respects reduced motion, and only shows on long posts."

TL;DR: I shipped a WordPress plugin that adds a “Back to Top” button without JavaScript. It only renders on long posts, hides on desktop, respects prefers-reduced-motion, and doesn’t dunk your CLS. It’s called VAX Micro UX.

Why this exists
Most “Back to Top” widgets are 30KB of JS to do a native anchor jump. We turned a one-line feature into a cottage industry of scroll listeners, icon fonts, and layout jank.

I wanted the opposite: something you forget you installed.

No JS. Native anchor + smooth scroll (and we disable it for reduced-motion).

Contextual. Only appears on long posts (default ≥ 900 words).

Mobile-first. Hidden ≥ 900px by default—because desktops have page-up keys and sane scroll wheels.

Zero settings. Activate and move on.

How it works (boring on purpose)
Prints a #va-top anchor with wp_body_open.

On long single posts, prints a floating link with a small inline SVG arrow.

Injects a tiny CSS block for native smooth scroll and a focus ring.

No database writes, no tracking, no external assets.

Customize without opening the plugin
You can tweak thresholds and colors with filters:

php
Copy code
// functions.php or a small mu-plugin
add_filter('vax_backtop_min_words', fn()=> 1200); // show only on 1200+ words
add_filter('vax_backtop_mobile_breakpoint', fn()=> 768); // hide on >= 768px
add_filter('vax_backtop_bg', fn()=> '#ffd400'); // acid yellow button
add_filter('vax_backtop_fg', fn()=> '#000000'); // black arrow
That’s it. No admin pages. No “Pro” upsell. If you want a control panel for a back-to-top link, we disagree about life.

Accessibility notes
Uses a real link with aria-label, so it’s keyboardable and screen-reader friendly.

Adds a focus-visible ring.

Honors prefers-reduced-motion (native smooth scroll off).

Install
Install VAX Micro UX from wp.org (or upload the ZIP).

Activate.

Write something long and actually worth scrolling. The button appears on mobile near the bottom right.

When a feature can be done in CSS and markup, do it in CSS and markup. Save your JS budget for things that aren’t already built into the browser.

— VibeAxis (receipts, not vibes)


This content originally appeared on DEV Community and was authored by Jason Bann


Print Share Comment Cite Upload Translate Updates
APA

Jason Bann | Sciencx (2025-09-13T12:32:10+00:00) A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX). Retrieved from https://www.scien.cx/2025/09/13/a-no-js-back-to-top-that-isnt-cringe-vax-micro-ux/

MLA
" » A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX)." Jason Bann | Sciencx - Saturday September 13, 2025, https://www.scien.cx/2025/09/13/a-no-js-back-to-top-that-isnt-cringe-vax-micro-ux/
HARVARD
Jason Bann | Sciencx Saturday September 13, 2025 » A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX)., viewed ,<https://www.scien.cx/2025/09/13/a-no-js-back-to-top-that-isnt-cringe-vax-micro-ux/>
VANCOUVER
Jason Bann | Sciencx - » A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/13/a-no-js-back-to-top-that-isnt-cringe-vax-micro-ux/
CHICAGO
" » A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX)." Jason Bann | Sciencx - Accessed . https://www.scien.cx/2025/09/13/a-no-js-back-to-top-that-isnt-cringe-vax-micro-ux/
IEEE
" » A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX)." Jason Bann | Sciencx [Online]. Available: https://www.scien.cx/2025/09/13/a-no-js-back-to-top-that-isnt-cringe-vax-micro-ux/. [Accessed: ]
rf:citation
» A No-JS ‘Back to Top’ that isn’t cringe (VAX Micro UX) | Jason Bann | Sciencx | https://www.scien.cx/2025/09/13/a-no-js-back-to-top-that-isnt-cringe-vax-micro-ux/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.