# The Nucleus Stack
Rich HTML apps - implementing the novel [ASO architectural pattern](./adapter_state_orchestrator.md).
Live demo: fully RESTful Todo app - under 50 lines of code, zero app JS, no build process.
No components, no virtual DOM, no second copy of application state tucked away in JS memory, and no build process.
## How it's different from existing UI solutions - **Back to the future πβ‘οΈ** Welcome back to building static HTML5 apps. A break from complex JavaScript apps that compile to HTML. - **Little to no JavaScript** You no longer need to write JS for the vast majority of UI cases. You may still call-out to your own pure functions for complex cases. - **Native++** Just HTML with a derivative of CSS, named Quark, sprinked on top. - **No magic** No special frameworks, build processes, rendering wizardry, or "HTML-in-my-JS" / "JS-in-my-HTML" DSLs. - **Progressively enhanced** Drop into existing static/server-side-rendered sites. Neutron and Quark can also be used independently. - **Fully composable** Templates, templating, behavior, and custom logic are all decoupled & robust. - **Reactive State Machine** A simple, reliable, declarative syntax for your business logic - Quark. - **No reconciliation tax** No large memory copies of state/DOM to be rebuilt, diffed against the DOM, recompiled with every state change. - **Lightweight** Neutron + Quark + all Nucleus Kit elements have a smaller footprint (just over ~50kb compressed) than some UI framework cores alone. ## What's in the stack - **π§© Nucleus Kit elements** A growing catalog of drop-in custom elements, including: drawers, tabs, tables, lazy views, forms, routing, passkeys, data fetching, and more. - **β‘ Quark** Like CSS, for document mutation. Select elements, bind data, stamp lists, wire events, and drive state transitions with simple rules instead of imperative code. - **βοΈ Neutron** The small JS factory used to author the elements above. Reach for it only when the Nucleus Kit catalog lacks what you need. Optional. - **π¨ Valence.css** Semantic, classless CSS that caters to both native and custom elements, with themes, light/dark schemes, and design tokens. Designed for easy drop-in. Optional. Every piece stands alone. Use one element on an existing site, or compose the whole stack into a full single-page app. `nucleus-kit` bundles it all behind one import; if you find you only use a handful of elements, install those packages Γ la carte instead (`@excom/content-drawer`, `@excom/quark-sheet`, β¦) and skip the rest. ## Why teams pick it - **Significantly less app code** This is possible for two primary reasons. First, because Nucleus Kit elements are fully composable, configurable, and controllable, they will likely be compatible with the desired experience of most applications that use them; there is a low likelihood you will need to build your own. Secondly, Quark enables the majority of customization without needing to invite JavaScript. - **No components** There is no "component" concept in this architecture. This allows application pieces to be maximally reusable and composable, as there is no home to entrap logic with a tightly coupled view. - **One source of truth** Live markup _is_ the primary application state, so an entire family of bugs ("the UI disagrees with the model") cannot exist. - **Fully inspectable** Open devtools and the entire application is in front of you: every value, every binding, and every transition. The state serializes to the document/DOM, so all is plainly transparent to see and debug. - **Accessible by default** Declarative & ARIA state is the state... not a mirror someone forgot to update. - **Human and machine friendly** Inspect this site to see its declarativeness. No more `