UI framework · ES modules · Open source
The building blocks of an application, with no dependencies
Athena UI gives you forms, tables, charts, dialogs, menus, a router and themes, a dashboard of widgets, a Kanban board and a code editor, in plain ES modules. Use one component from its own entry point, or let one call build the whole page layout.
- No dependencies
- No build step
- Strict CSP friendly
- MIT licence
At a glance
- 0dependencies: nothing is loaded at run time, nothing is put on window
- 1 importper component: an entry point for every area, so the rest is never downloaded
- Light, darkor like the system, with a theme manager, a picker and no flash
- 2 languagesEnglish and Hungarian, and TypeScript definitions
What is in it
Everything an application needs between the data and the person who uses it. Each part also works on its own.
Tables
Sorting, filtering, pages, row selection, inline editing, resizable columns, expanding rows, a stacked layout for narrow screens, virtual scrolling for thousands of rows, rows from a server and CSV export.
Charts
Bar, line, area, sparkline, pie and donut in SVG: a time axis, tooltips, zoom, a clickable legend, a table of the values, streaming and animated updates.
A dashboard of widgets
Move, resize, add from a gallery, lock, undo and redo, a layout for every width, saved as JSON. With the mouse, a finger or the keyboard.
Kanban board
Columns of cards that move with the mouse, a finger or the keyboard, with a JSON tree, cards, badges, avatars, KPI tiles and empty and loading states beside it.
Forms
A form builder with validation and server errors, form dialogs, and sign-in and password forms that password managers understand.
Inputs
Autocomplete, multi select, file upload with a drop area, a stepper, date and time ranges, and a rich text editor.
Code
Syntax highlighting, a code editor on a real textarea (with folding, a minimap and several cursors), and a diff view.
Navigation
A menu with groups, badges and a user menu, as a bar, a vertical rail or tabs at the bottom of a phone; tabs, accordion, dropdown, sidebar, breadcrumbs and a router.
Dialogs and feedback
Native dialogs and confirmations, toasts, alerts, a spinner, a progress bar and tooltips, with animations that respect reduced motion.
Themes and tokens
Colours, shape and type are CSS variables. A theme is two blocks of them; the styles sit in a cascade layer, so your own CSS always wins.
Safe by design
The DOM is built with text that stays text: no event attributes, no inline script or style. It runs under a strict Content-Security-Policy.
Keyboard and screen readers
Keyboard support and ARIA across the components: the board, the dashboard and the charts can be used without a mouse.
The demo application
The demo shows every group of components with its code, served by a small Node.js server under a strict Content-Security-Policy. The screenshots show its sample data, in its Ocean theme.
Made for phones too
On a small screen the menu turns into tabs at the bottom, tables can stack their rows, and dialogs fit the screen.
Get started
Install it from npm, then import only what you use. Without npm, serve the src folder with any static web server.
Install
The package is athena-ui-js.
npm install athena-ui-js
Import
Everything at once, or one entry point per area.
import { init, generateTable } from "athena-ui-js";
import { generateTable } from "athena-ui-js/table";
What it needs
| Browser | Chrome or Edge 99, Safari 15.4, Firefox 97 or later: ES modules, native dialogs and cascade layers |
|---|---|
| Server | Any web server over HTTP or HTTPS (modules do not load from file://) |
| Dependencies | None at run time |
-
The guide
One page per area, from charts and tables to themes, and the API at a glance.
-
The source
The code, the tests and the release notes.
-
The package
Versions, the files in the package and the install command.
Code examples
Plain JavaScript, one import per area. Every example is short on purpose: the guide has all the options.
Table athena-ui-js/table
Sorting, a filter box and pages. The rows can come from a server.
import { generateTable } from "athena-ui-js/table";
const table = generateTable({
parent: "#hosts",
caption: "Hosts",
columns: [
{ key: "name", label: "Host" },
{ key: "cpu", label: "CPU", align: "right", format: v => `${v} %` }
],
rows: [{ name: "web-01", cpu: 42 }, { name: "db-01", cpu: 7 }],
filter: true,
pageSize: 10,
onRowClick: row => openHost(row.name)
});
table.setRows(await loadHosts()); // new data, same table
Chart athena-ui-js/chart
Inline SVG in the colours of the theme, with tooltips, a legend and a table of the values.
import { generateChart } from "athena-ui-js/chart";
const chart = generateChart({
type: "line", // bar, line, area, sparkline, pie, donut
parent: "#revenue",
title: "Revenue",
labels: ["Q1", "Q2", "Q3"],
series: [
{ name: "2025", data: [12, 19, 8] },
{ name: "2026", data: [14, 17, 12] }
],
table: true // "Show as table", for everyone
});
chart.update({ series: newSeries }); // the lines move to the new values
Form athena-ui-js/forms
Fields, rules and messages. onSubmit runs only when every field is valid.
import { generateForm } from "athena-ui-js/forms";
generateForm({
parent: "#signup",
submitText: "Save",
fields: [
{ name: "name", label: "Name", required: true, minLength: 2 },
{ name: "email", label: "Email", type: "email", required: true },
{ name: "plan", label: "Plan", type: "radio",
options: ["Free", "Pro"], value: "Free" },
{ name: "news", label: "Newsletter", type: "switch" }
],
onSubmit: async values => { await save(values); }
});
Dialogs athena-ui-js/dialog
Native dialogs: a form in a dialog, and a confirmation that can ask to type the name.
import { showFormDialog, showConfirm } from "athena-ui-js/dialog";
const saved = await showFormDialog({
title: "Add host",
submitText: "Add",
fields: [{ name: "name", label: "Name", required: true }],
onSubmit: values => api.addHost(values) // an error shows in the dialog
});
if (await showConfirm({
title: "Delete host",
message: "This cannot be undone.",
confirmText: "Delete",
danger: true,
typeToConfirm: "web-01"
})) {
await api.deleteHost("web-01");
}
Router athena-ui-js/router
Pages, parameters and a guard, in a single-page application.
import { createRouter } from "athena-ui-js/router";
const router = createRouter({
outlet: "wrapper",
routes: {
"/": () => renderHome(),
"/users/:id": ({ params }) => renderUser(params.id),
"/admin": { handler: renderAdmin, title: "Admin" }
},
beforeEach: ({ path }) =>
path === "/admin" && !isLoggedIn() ? "/login" : undefined,
notFound: () => renderNotFound()
});
router.start();
router.navigate("/users/5?tab=info");
Widget dashboard athena-ui-js/widgets
A widget type, and a grid people can arrange. The layout is plain JSON you can save.
import { registerWidget, createWidgetGrid } from "athena-ui-js/widgets";
registerWidget("clock", {
title: "Clock",
defaultSize: { w: 3, h: 2 },
render({ element }) {
const time = document.createElement("p");
element.append(time);
const show = () => time.textContent = new Date().toLocaleTimeString();
const timer = setInterval(show, 1000);
return { update: show, destroy: () => clearInterval(timer) };
}
});
const grid = createWidgetGrid({
element: "dashboard", columns: 12, rowHeight: 80, editable: true,
widgets: [{ type: "clock", x: 0, y: 0 }],
onChange: layout =>
localStorage.setItem("dashboard", JSON.stringify(layout))
});
Light and dark athena-ui-js/theme
Themes and modes, remembered in the browser. This page uses it for its own switch.
<!-- in <head>, before the stylesheet: no flash on load -->
<script src="theme-boot.js" data-key="myapp.appearance" data-theme="athena"></script>
import { createThemeManager } from "athena-ui-js/theme";
const theme = createThemeManager({
themes: [{ id: "athena", name: "Athena" },
{ id: "contrast", name: "High contrast" }],
storageKey: "myapp.appearance"
});
theme.setMode("dark"); // "system", "light" or "dark"
theme.onChange(({ dark }) => redrawCharts(dark));