⏱️ Reading time: 8 min

A modal dialog, a dropdown menu listing date ranges and a tab that filters overdue invoices. All three open in the Alloy CSS demo without the browser running a single line of JavaScript (source). That is Alloy CSS without JavaScript in its purest form: interface components that today usually depend on a framework, built with nothing but HTML and CSS.

📑 En este artículo
  1. What Ledger, the Alloy CSS Without JavaScript Example, Does
  2. Why It Matters for Teams Building Internal Dashboards
  3. The Problem the Demo Does Not Solve: Accessibility
  4. Alloy CSS Versus Other Ways to Achieve the Same Result
  5. Limitations: When Alloy CSS Falls Short
  6. What This Means for You If You Build Internal Dashboards
  7. References

The demo is called Ledger, a fictional invoicing dashboard that fits in a single HTML file. It simulates 24 invoices from the last 90 days, with three overdue invoices totaling $4,860 and two unsent drafts, one for Okafor Legal and another for Tidewater Coffee (source).

What Ledger, the Alloy CSS Without JavaScript Example, Does

Ledger is not a real product anyone can sign up for. It is the demo piece Alloy CSS publishes to show how far an interface built only with HTML markup and CSS selectors can go. The dashboard includes the three components that usually justify adding JavaScript to any project: a modal dialog for creating a new invoice, a dropdown menu for choosing the date range (“Last 90 days”, “This month”, “This year”, “All time”) and a row of tabs for filtering by status (“All 24”, “Overdue 3”, “Paid 10”, “Drafts 2”) (source).

There is also an FAQ accordion that expands and collapses without JavaScript, with answers covering the reminder policy (three days before the due date, on the due date itself, and every seven days after) or whether a client can pay an invoice in installments: yes, the invoice stays open showing the remaining balance until the rest arrives (source). Each of these behaviors (opening, closing, filtering, expanding) is the kind of interactivity that normally triggers a click handler, in-memory state and a re-render.

Technically, the family of tricks that makes this possible is not new: attributes like popover, the <dialog> element and pseudo-classes like :checked or :target have been available in modern browsers for years to toggle states without a single line of script. What a library like Alloy CSS adds is packaging those loose pieces into ready-to-copy components, not inventing a new technique.

Ledger simulates 24 invoices in a JavaScript-free dashboard. Foto de Gabriel Heinzer en Unsplash

The logic behind it is progressive enhancement: first an HTML document that works on its own, then a layer of CSS that adds visual behavior, with JavaScript sitting on top as optional rather than mandatory.

flowchart TD
A["Semantic HTML: forms and buttons"] --> B["+ CSS: dialogs, menus, tabs"]
B --> C["+ Optional JavaScript: validations, API calls"]

Why It Matters for Teams Building Internal Dashboards

The audience that benefits most from this approach is not a public landing page, but internal dashboards: the kind of invoicing, inventory or support screen that only employees see and that a platform team maintains for years. There, every JavaScript dependency added is a dependency that later has to be patched, versioned and tested against the rest of the stack.

In the Hacker News thread about the demo, user kyledrake summarized the underlying argument: if web standards focused on letting the browser do more without JavaScript, submitting a form dynamically should not depend on JS, something they describe as “extremely excessive and a security problem.” For kyledrake, avoiding that dependency would allow relying more on CSP headers instead of code running on the client (source).

The practical takeaway for a developer is concrete: if your organization already enforces a strict Content Security Policy, with no inline scripts and an origin allowlist, a dashboard built like Ledger reduces what needs to be audited and what can go wrong in a security code review. Less JavaScript also means fewer bytes to download and parse on every load, something that matters more on slow corporate networks or for support teams with old hardware than on a developer’s fiber-connected laptop at home.

The Problem the Demo Does Not Solve: Accessibility

The most notable objection in the thread came from lopis. In Ledger, when the user selects several invoices, a “Selected invoices” panel appears with buttons to send reminders or download. The change is purely visual: CSS can show or hide a block, but it does not by itself notify a screen reader that something changed on the page. For that to happen, an ARIA attribute is needed, for example a region with aria-live, to announce the change, and CSS does not add that attribute (source).

It is the least advertised side of removing JavaScript from the equation: the accessibility problem does not disappear, it moves. Before, developers had to remember to announce the change from the code that displayed the panel; now they have to remember to add the correct ARIA attribute to the HTML, even though no one writes a single line of logic to show it.

Another comment in the same thread, from bflesch, pointed in a different direction: “now you know why it’s convenient for Google to build a browser” (source). The reading is that as long as the web depends on heavy JavaScript frameworks, whoever controls the dominant browser also controls how expensive it is to compete with it. It is an argument that cannot be verified with data, but it captures the community’s distrust of any solution that depends on every browser implementing the same thing equally well.

Three overdue invoices total $4,860 in the demo. Foto de Emile Perron en Unsplash

Alloy CSS Versus Other Ways to Achieve the Same Result

Nothing Ledger does is exclusive to Alloy CSS. It is one of several ways to reach the same result, dialogs, menus and tabs without mandatory JavaScript, and choosing between them depends more on how much markup you are willing to write by hand than on any deep technical difference.

ApproachNeeds JavaScript?How it solves itBest for
Alloy CSSNo, by designReady-to-copy CSS components (dialogs, menus, tabs) on top of semantic HTMLInternal dashboards and demos where JS stays optional
Native APIs (<dialog>, popover)NoElement and attribute already supported by the browser, no library involvedTeams that prefer not to add any dependency, CSS or JS
BootstrapYes, for modals and dropdownsCSS components plus its own JavaScript handling open and close stateProjects that already accept JS in exchange for a complete design system
Pico CSSNot for the basicsStyles semantic HTML elements like <details> and <dialog> without adding its own behaviorSites with minimal markup already using native browser elements

The difference between Alloy CSS and native APIs is more about packaging than substance: both bet that the browser already knows how to open a dialog or expand a menu, and the library only adds ready-to-copy components instead of writing the HTML and CSS from scratch. Bootstrap plays a different game: it never promised to remove JavaScript from the equation, so it remains the logical choice when a team has already accepted that cost in exchange for a complete, documented design system.

Limitations: When Alloy CSS Falls Short

The example page does not publish a version number, a changelog or a list of supported browsers. Before copying a component into a real dashboard, it is worth reviewing the source code the demo itself links at the bottom of the page and testing it with the browser and screen reader combinations your team actually uses, instead of assuming that what works in the demo works the same way in production.

Some of the pieces that make this kind of interactivity possible, like the popover attribute or certain newer CSS selectors, have been available for less time than the rest of the web platform. A team that still supports old corporate browsers should verify compatibility before betting an entire dashboard on this approach.

The approach also has a functional ceiling. CSS can show, hide and toggle states (open a dialog, switch a tab, expand a menu), but it cannot fetch new data from the server or update a table without reloading the page. As soon as a dashboard needs live data, pagination that does not reload everything, or a form that validates against an API before submitting, JavaScript becomes necessary again, and Alloy CSS does not promise to solve that part.

It does not solve accessibility by default either, as lopis’s objection already pointed out: a visually complete component can still be invisible to someone using a screen reader if no one adds the ARIA attributes it needs.

What This Means for You If You Build Internal Dashboards

If your job includes maintaining the kind of screen only employees see (invoicing, inventory, support, an operations dashboard), the Ledger demo is a reasonable starting point for two concrete decisions. First, check whether your CSP policy already restricts inline JavaScript: if it does, an approach like Alloy CSS reduces what you need to allowlist and what can fail in a security review. Second, before copying any component from the demo into production, test it with a real screen reader (VoiceOver, NVDA, Orca) and add any missing ARIA attributes, particularly on any panel or banner that appears after a selection, like the “Selected invoices” panel lopis pointed out (source).

If your dashboard needs live data, API calls without reloading the page, or server-side form validation, there is no way around it: JavaScript remains necessary there, and no CSS framework, Alloy CSS included, promises to solve that for you.

References

Featured image: Foto de Jackson Sophat en Unsplash

📬 Get new articles by email

We only email about big articles (1-2 a month).

How each article is made (sources, testing and editorial criteria): How we work.

Did it work for you? Got a different error? Say so below: questions get answered and help the next reader.

Leave a comment
Categories: ProgrammingTutorials

El Solitario Editorial

Article prepared by the El Solitario editorial team from cited sources, under the editorial responsibility of Luis Navarro. More details in "How we work".

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

You can include code inside <code>…</code> or, for several lines, <pre><code>…</code></pre>.

This site uses Akismet to reduce spam. Learn how your comment data is processed.