Docs menu

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.

ModuleWhat is in it
elementdiv, text, icon, img, canvas, Element and its builders, Tok, Paint, StateStyle, Enter, LaidOut.
uiUi (widgets, drawing, motion, focus, scroll), Input, UiKey, ButtonVariant, TextStyle, Fit, Cursor, Breakpoint, Insets, Toasts, NavItem, Swipe.
runnerrun, the App trait, Cx, Proxy, Exit.
eventsWindowInput (winit events to Input) and cursor_icon.
platformClipboard and soft_input (keyboard, insets).
gestureThe gesture Recognizer, Gesture, Drag, Axis, Dir, Phase and the thresholds.
themeTheme, Radii, motion tokens and easing, hex, lerp, with_alpha.
idElementId: new(name), .key(value), .part(name).
inputInputKind and the text Editor.
layoutOlder helpers for immediate-mode layout: Row, Column, ShellLayout.
markdown, editorMarkdown styling and the multi-line editor ANVL Note uses.
logoThe ANVL mark and wordmark as pixels at any size.
re-exported from anvl_gpuRenderer, 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

VariableEffect
ANVIL_UPDATE_SNAPSHOTS=1Rewrite the reference screenshots in crates/anvil_ui/tests/snapshots instead of comparing.
ANVL_STARTER_DIRWhere the starter keeps tasks.txt.
ANVIL_NOTE_DIR, ANVIL_NOTE_LOCAL_ONLY=1ANVL 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=1ANVL Note draws continuously and prints frame timings; or prints frames per second and pending wakes.

The repository

PathWhat it is
ANVIL-UI-2.mdThe anvil_ui 2.0 plan and what each phase delivered, with measurements and decisions.
ADL-V3.md, ADL-MOBILE.mdThe design language: tokens, components, motion, mobile.
crates/anvil_ui/tests/Layout, interaction and screenshot tests: good examples of each API.
crates/anvl_gpu/README.mdHow the renderer works.
apps/anvl_starterThe template app.
anvl-web/anvl.dev/docsThese pages. Edit _pages/*.html, then run python anvl-web/anvl.dev/docs/_build.py.