Reference
Where everything lives. The source is the full reference: every public item has a
doc comment, and cargo doc -p anvil_ui --open builds it as pages.
anvil_ui modules
Apps depend on anvil_ui only; it re-exports what you need from anvl_gpu.
| Module | What is in it |
|---|---|
element | div, text, icon, img, canvas, Element and its builders, Tok, Paint, StateStyle, Enter, LaidOut. |
ui | Ui (widgets, drawing, motion, focus, scroll), Input, UiKey, ButtonVariant, TextStyle, Fit, Cursor, Breakpoint, Insets, Toasts, NavItem, Swipe. |
runner | run, the App trait, Cx, Proxy, Exit. |
events | WindowInput (winit events to Input) and cursor_icon. |
platform | Clipboard and soft_input (keyboard, insets). |
gesture | The gesture Recognizer, Gesture, Drag, Axis, Dir, Phase and the thresholds. |
theme | Theme, Radii, motion tokens and easing, hex, lerp, with_alpha. |
id | ElementId: new(name), .key(value), .part(name). |
input | InputKind and the text Editor. |
layout | Older helpers for immediate-mode layout: Row, Column, ShellLayout. |
markdown, editor | Markdown styling and the multi-line editor ANVL Note uses. |
logo | The ANVL mark and wordmark as pixels at any size. |
re-exported from anvl_gpu | Renderer, FrameStatus, RenderTimings, Rect, RectStyle, DrawList, Icon, IconAtlas, TextureId, Frame, decode_image, Video, TextSystem, FontRole, the weights, and the draw, geom, path, text, media modules. |
Dependencies
An app needs three lines; versions come from the workspace:
[dependencies]
anvil_ui.workspace = true
winit.workspace = true # the window and its events
glam.workspace = true # Vec2
The engine itself depends on wgpu (the GPU), winit (windows), cosmic-text (shaping), Taffy (layout) and glam (vectors), plus arboard for the desktop clipboard and JNI on Android. Images, icons, the glyph atlas, fonts, inflate and video decoding are ANVL's own.
Environment variables
| Variable | Effect |
|---|---|
ANVIL_UPDATE_SNAPSHOTS=1 | Rewrite the reference screenshots in crates/anvil_ui/tests/snapshots instead of comparing. |
ANVL_STARTER_DIR | Where the starter keeps tasks.txt. |
ANVIL_NOTE_DIR, ANVIL_NOTE_LOCAL_ONLY=1 | ANVL Note's notes folder; turn its sync off (use both when testing, to keep test notes away from your own). |
ANVIL_NOTE_BENCH=1, ANVIL_NOTE_TRACE=1 | ANVL Note draws continuously and prints frame timings; or prints frames per second and pending wakes. |
The repository
| Path | What it is |
|---|---|
ANVIL-UI-2.md | The anvil_ui 2.0 plan and what each phase delivered, with measurements and decisions. |
ADL-V3.md, ADL-MOBILE.md | The design language: tokens, components, motion, mobile. |
crates/anvil_ui/tests/ | Layout, interaction and screenshot tests: good examples of each API. |
crates/anvl_gpu/README.md | How the renderer works. |
apps/anvl_starter | The template app. |
anvl-web/anvl.dev/docs | These pages. Edit _pages/*.html, then run python anvl-web/anvl.dev/docs/_build.py. |