--- title: UIX — the thesis type: reference audience: human + agent authority: E1 architecture — the narrative introduction to the four layers and their boundaries status: current source: migrated from src/uix/README.md (2026-07-02, docs-book F7.2) --- # UIX A short architectural positioning document for `src/uix`. > **Whole-system view**: to understand the four layers (morfo, soma, sema, > eidos) in a single read — motivations and articulation included — go to > [`active-architecture`](./active-architecture.md). This document > keeps the more narrative introduction. > > **Semantic vocabulary** (families, intents, verbs, channels): the single > source of truth is [`CANON.md`](../CANON.md), anchored to the book and the > code. (The original Spanish implementation guide survives as a historical > seed at [`decisions/guia-semantica-historica.md`](../decisions/guia-semantica-historica.md).) UIX does not try to be "another component library". The bet is more ambitious and structural: **separate layers that almost every current framework keeps mixed together**. In most UI systems these things live glued to each other: - the component's public DOM contract - headless behavior - accessibility - event semantics - the visual layer - modal engines (sound, haptic, motion) - app-service integration UIX splits that block into pieces with strong boundaries. --- ## 1. The central idea UIX models the interface as several cooperating layers, not as one giant component that does everything at once. ```text App ├─ cross-cutting services (active-app) │ └─ adom, langs, format, ... └─ components └─ structural / semantic / behavioral / visual layer ``` The intuition: - a component's public structure is not the same as its behavior - an event's semantics are not the same as its materialization - the active DOM is not the same as pure DOM utilities - the app should not couple modal engines to each other UIX gives those separations explicit names and contracts. --- ## 2. The UIX layers ### `Morfo` (`src/uix/morfo/`) The component's cross-layer structural contract. It declares `parts`, `data-*`, ARIA, focus, keyboard, events and — when text belongs to the contract — the component's `texts` slots (idlangrefs). It is neither prose nor runtime: it is the canonical public shape. See: [`architecture/morfo.md`](./morfo.md) ### `Sema` / Events (`src/uix/sema/`) The semantic vocabulary and the orchestration of perceptual events. `sema` remains the historical folder name; `ActiveUix`'s public surface calls the service `events`. - canonical families (8): `contact`, `commit`, `signal`, `handle`, `emerge`, `shift`, `sustain`, `delegate` - canonical intents: `neutral`, `affirm`, `fulfill`, `risk`, `threat`, `loss` - `uix.events.emit(signal)` for providers to publish occurrences - a channel registry (`VisualChannel`, `SoundChannel`, `HapticChannel`) - `src/uix/sema/channels.ts` as the single source of channel ids, signatures and overrides - `src/uix/sema/sounds.ts` as the single nominal repository of synthetic sounds, external `.wav`s and dynamic recipes - the `VisualChannel`'s window: it prepares `data-event-*` through a DOM projector, holds them for the `hold` window, waits for the expression and cleans up BEFORE resolving `EmitHandle.settled` — a window that gates nobody, since `emit` returns its handle synchronously (D-full, 2026-09-15) Sema does not decide what happened (the provider decides that). It only orchestrates the occurrence and dispatches it to the registered channels. See: [`architecture/sema.md`](./sema.md) ### `Soma` (`src/uix/soma/`) The headless behavior layer: state, context, a11y, keyboard / pointer / focus, event emission. Soma does not know the concrete implementation of the modal engines. Its job is to emit the component's facts, not to materialize them. See: [`architecture/soma.md`](./soma.md), [`SOMA_ARCHITECTURE.md`](./soma-architecture.md) ### `Eidos` (`src/uix/eidos/`) The visual layer: tokens, themes, per-component CSS recipes, archetype rules, event reactions and **Svelte wrappers** over soma's headless providers with the visual props (variant, size, block, iconOnly, icon, checkMark). The general module is flattened into `ActiveEidos`: - `ActiveEidos` — the active runtime / visual context created by `ActiveEidos.create(...)`. It manages visual configuration, primitives, canonical roles, themes, validation, CSS generation and persistence. With `ActiveUix` services it receives `dom`, `langs`, `prefs` and `format`; `mode` and `density` arrive through explicit sources or its own defaults. It injects `