Guides, concepts and the reference, and a page for every component with a live specimen.
01Start
- 01.1Introduction
amenui is an interface framework that draws every pixel itself, written in Rust on wgpu; the same code runs in a native window and on the web. Everything on screen — glyphs,…
- 01.2Installation
Pick the host your interface lives in. All three draw the same pixels: the framework draws everything itself, and the host only gives it a surface, input and time.
- 01.3Your first view
A view is a function from state to an element tree; an update is a function from state and a message to a new state. Messages are plain values.
- 01.4Project structure
Where things are in the amenui repository. The crate is one library with a few command-line tools; this site, its gallery and the Lab live in a separate repository,…
02Guides
- 02.1Forms
A form is state and messages, like everything else: the state holds every value, each widget sends a message for each edit, and update is the only place a value changes. Text…
- 02.2Theming and dark mode
A theme is a set of colours and the faces for display, body and monospace ( style::THEMES ). Paints are names, not colours: Paint::INK , TEXT , DIM , FAINT , GROUND , ACCENT…
- 02.3Languages
Every string on screen comes from a message catalog, one per language, so an application can ship in any language without touching its views.
- 02.4Right to left
A row lays out from the right when its direction is right to left: El::rtl(true) on the row (or any ancestor), or a locale that reads right to left. Taffy's Direction::Rtl does…
- 02.5Accessibility
The screen is drawn by the framework, not by the platform's controls, so the runtime keeps a second, invisible copy of the interface for assistive technology: the accessibility…
- 02.6Testing with render and the tree
Every recipe can be driven from outside without a window: render opens it offscreen, plays a list of input events on a fixed 60 Hz clock from 0 with fixed seeds, and writes the…
- 02.7Performance
Draw only when something changed; draw only what changed (two boxes); scrolling moves, it does not lay out again; a long list builds only the rows that show; the material can…
- 02.8Development
The architecture reference maps what each module owns. This guide covers building, testing and the tools in this repository.
Recipes
- 02.9The annotation layer on a subtree
- 02.10A chapter: one scene with actors that flow in
- 02.11A dot chart
- 02.12A counter with recomposition and a scoped ripple
- 02.13A dialog
- 02.14A page change with a shared part
- 02.15A form
- 02.16Text on a form
- 02.17Gestures: a bottom sheet and a floating box
- 02.18A list with selection
- 02.19A list that loads
- 02.20A custom material on one element
- 02.21A 3D object in a card
- 02.22Morph A into B
- 02.23A custom preset
- 02.24A stack of cards that fans
- 02.25A menu with submenus and a safe zone
03Concepts
- 03.1Overview
After every message the runtime calls view(&state) once, gets a new El tree, compares it with the last by key and lays out again only what changed. The state is the only…
- 03.2Text
Text is set by parley and rasterised by swash; every atlas pixel holds coverage and the signed distance to the stroke, so every material draws a glyph by its true outline. A…
- 03.3Materials and looseness
A material is how the second pass draws: plain, dottr, halftonr, charr, smudgr, carvr, glitchr, near, scribblr. At rest they look like plain (but for the few with a look of…
- 03.4Annotation
The third pass is the annotation layer: frames, numbers, sizes, leaders and rulers drawn from the real layout, never loosened. El::annotate(text) writes a callout; {xy} becomes…
Design
- 03.5Design
- 03.61. The pipeline
- 03.71.2 Layout
- 03.81.3 The scene (
scene.rs) - 03.91.4 The two G-buffer targets
- 03.101.5 The wave field
- 03.111.6 Materials
- 03.121.6.1 How a picture turns into marks
- 03.131.6.2 The materials
- 03.141.6.3 Pixel type
- 03.151.6.4 Materials as source
- 03.161.6.5 Faces that come later
- 03.171.6.6 Glyph outlines, between letters
- 03.181.7 The annotation layer
- 03.191.8 Input
- 03.201.8.1 Text input
- 03.211.8.2 Pointer, touch and wheel
- 03.221.8.3 How scrolling looks
- 03.231.8.4 Gesture physics (
src/gesture.rs) - 03.241.8.5 Nested menus and the safe zone
- 03.251.9 Platforms
- 03.261.10 Transforms
- 03.271.11 Drawing only when something changed
- 03.281.12 The frame-time readout and the resolution budget
- 03.291.13 Incremental updates and long lists
- 03.301.14 The accessibility mirror
- 03.311.15 Ripple rules
- 03.321.16 Recomposition
- 03.331.17 The surface for models
- 03.341.18 3D
- 03.351.19 Drawing only what changed
- 03.361.20 Languages
- 03.371.21 The finishing pass: post effects, dithering and palettes
- 03.381.22 Marks that move by themselves: shedding and flow fields
- 03.391.23 How loading looks
- 03.401.24 A stack of cards
- 03.411.25 A dot chart
- 03.421.26 Fields, drawings and glyph poses
- 03.431.27 The frame budget for marks
- 03.441.28 The decode transition
- 03.451.29 The field map and trails
- 03.461.30 The thread material
scribblrand long paths - 03.471.31 The audit
- 03.481.32 The beat
- 03.491.33 Plates
- 03.501.34 Effects that can be turned off
- 03.511.35 The stage
- 03.521.36 Drawn once: cached subtrees and round clips
- 03.533. Components
- 03.544. Style = theme × material × material parameters × annotation × faces
- 03.555. The gallery
- 03.566. Scenes
- 03.577. What is done and its acceptance
- 03.588. Layout
- 03.599. Where the implementation differs from the design
04Components
- Inputs
- 04.1button
- 04.2number
- 04.3input
- 04.4switch
- 04.5slider
- 04.6choice
- 04.7checkbox
- 04.8radio
- 04.9select
- 04.10toggle
- Display
- 04.11image
- 04.12orbit
- 04.13badge
- 04.14avatar
- 04.15skeleton
- 04.16caption
- 04.17card stack
- Feedback
- 04.18dialog
- 04.19tooltip
- 04.20popover
- 04.21toast
- 04.22progress
- 04.23sheet
- 04.24bottom sheet
- Navigation
- 04.25tabs
- 04.26menu
- 04.27breadcrumb
- 04.28skip-link
- 04.29pagination
- 04.30context menu
- 04.31command
- 04.32nested menu
- Layout
- 04.33card
- 04.34divider
- 04.35scroll-area
- 04.36accordion
- 04.37floating
- Data
- 04.38list
- 04.39table
- 04.40dot chart
05Reference
- 05.1Command line
Components are distributed as source, the way shadcn/ui does it: you copy a component's file into your project and change it there. amenui add does the copying.
- 05.2Registry schema
registry.json lists every component as source to copy, the way shadcn/ui's registry does. amenui add reads it; the documentation's component pages are made from it.
- 05.3Registry
Components are distributed as source: amenui add <name> copies one and the files it depends on into your project.
- 05.4
AGENTS.mdamenui is a self-drawn interface framework in Rust (wgpu; the same code runs natively and on the web). Everything on screen — glyphs, shapes, pictures — is an instance with a…
- 05.5
llms.txtA self-drawn interface framework in Rust (wgpu, native and web). Views are plain trees of values; every glyph, shape and picture has a true outline that can loosen, morph and…
- 05.6Architecture
amenui is one Cargo package: a library, the amenui command line and two tools. Everything except render.rs and the shaders runs without a GPU, so the runtime can be driven and…
- 05.7Fonts
The fonts in assets/ are all under the SIL Open Font License 1.1. Their licenses are in assets/licenses/ . text::embedded() returns them compiled into the binary (about 14 MB,…
06Release notes
- 06.1Release notes
Newest first. The acceptance checks for each part are in DESIGN.md §7 .