DEV Community

Cover image for How to Build Interactive Web Pages Without Using JavaScript

How to Build Interactive Web Pages Without Using JavaScript

Shubham Tiwari on April 04, 2025

Hello my frontend developer friends, today i will be discussing an awesome thing with you guys which we could help you in writing less javascript c...
Collapse
 
tracygjg profile image
Tracy Gilmore • Edited

Hi Shubham, I am on a similar no/low JS quest with a couple of my projects. Both projects are data-centric (CRUD) applications, which makes things easier. The driver for one app was to ensure business logic and state were maintained entirely on the server. The other project is just to exercise a new (to us) technology for a hobby project.
In both cases we are using HTMX to facilitate client-server interaction. Were we need to employ some presentation state to improve user experience we are using Alpine JS, again to keep the amount of bespoke JS to a minimum.
We are having to employ a 3rd-party UI library, which requires configuration via JS, to contain this we wrap them in Web Components based on Lit, which we have found to be very effective.
Best Regards

Collapse
 
dansasser profile image
Daniel T Sasser II

HTMX for the win!
Try it with Astro, you won't be disappointed.
I built the Astro SSR SPA Template that uses them both together.

Collapse
 
shubhamtiwari909 profile image
Shubham Tiwari

Astro is Awesome specially their island architecture feature

Thread Thread
 
dansasser profile image
Daniel T Sasser II

Yes, it is. It has helped me out tremendously.

I spent 20 years developing websites and enterprise software with PHP. When I started looking for a JavaScript framework, I initially leaned toward NextJS. I still use NextJS on projects, especially those that involve PayloadCMS.

But then I discovered Astro and immediately fell in love with its template-like nature. The ability to use components from nearly any framework, such as React, Svelte, or Vue, made it an easy choice for me.

It's still the underdog. But I have high hopes for it.

Collapse
 
tracygjg profile image
Tracy Gilmore

Bonus feature, no bundling.

Collapse
 
jonrandy profile image
Jon Randy 🎖️

I will be using tailwind css v4 for the styling

Then you'll be using JS 😉

Collapse
 
shubhamtiwari909 profile image
Shubham Tiwari

With Tailwind V4 it is less or almost no JS shipped to the bundler as the configuration is done in a css file not JS file🥂

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

If you're building an interactive web page without JS, you should have no use for a bundler 😉

Thread Thread
 
shubhamtiwari909 profile image
Shubham Tiwari

👍

Collapse
 
ngdangtu profile image
Đăng Tú

I think moderators should be more strict on post like this... where is the part of no-js? I see a ton of js lib in here -_-

Collapse
 
shubhamtiwari909 profile image
Shubham Tiwari

@ngdangtu
Which Js lib bro?
Tailwind CSS?
It's version 4 has no JS dependency and only css configuration is needed to add the classes
Which JS lib is used here bro?
And I am also the moderator for dev.to🫤

Collapse
 
maclong profile image
Mac

This is amazing, I have been working on a library for rendering HTML in Swift from the server and have been a little obsessed with reducing JS code on the frontend as much as possible. This is perfect for the small component library I will be adding to the web renderer. Thank you.