You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page is the API map, not the onboarding guide.
Use it when you already know the SLT mental model and want to find the right method or state type quickly.
If you are new, read in this order first:
README.md
docs/QUICK_START.md
this file
For composition advice, see PATTERNS.md.
For animation, see the anim module.
If you only learn a small core first
Most apps can go a long way with this subset:
text()
row() / col()
container() / bordered()
button(), text_input(), checkbox()
list(), table(), tabs()
modal(), overlay(), tooltip()
use_state() / use_memo()
Return type conventions
Every widget method on Context follows one of these return patterns:
Return type
Meaning
When to use
&mut Self
Style-chainable display element
text, separator, progress, spinner, toast, spacer
Response
Interactive widget with click/hover/changed/focused/rect
Fluent builder — finalize with .col(), .row(), or .draw()
container, scrollable, bordered, group
Option<usize>
Index of selected segment, or None
breadcrumb
(Response, Option<usize>)
Row Response plus clicked segment index
breadcrumb_response, breadcrumb_response_with
()
Fire-and-forget side-effect
tooltip, scrollbar, notify, screen
Response fields:
pubstructResponse{pubclicked:bool,// clicked this framepubhovered:bool,// mouse hoveringpubchanged:bool,// value changed this framepubfocused:bool,// has keyboard focuspubrect:Rect,// layout rectangle (valid after layout pass)}
Text & Display
All return &mut Self for style chaining unless noted.
Yes/No dialog. result: &mut bool, Response.clicked on answer
breadcrumb(segments)
Clickable breadcrumb trail. Returns Option<usize>. Variants: breadcrumb_with(segments, sep); breadcrumb_response(segments) and breadcrumb_response_with(segments, sep) return (Response, Option<usize>) so you can read hover/focus/rect alongside the clicked index.
help(bindings)
Keybinding help bar from &[(&str, &str)]. Variant: help_colored(bindings, key_color, text_color)
help_from_keymap(keymap)
Help bar from a KeyMap struct
Note: separator() and separator_colored() return &mut Self (listed under Text & Display).
Layout & Containers
Method
Returns
Description
col(f)
Response
Vertical container. Variant: col_gap(gap, f)
row(f)
Response
Horizontal container. Variant: row_gap(gap, f)
line(f)
&mut Self
Inline rich text (zero-gap row, no interaction)
line_wrap(f)
&mut Self
Wrapping inline text
grid(cols, f)
Response
Fixed-column grid layout
container()
ContainerBuilder
Fluent builder for borders, padding, grow, constraints, title
scrollable(state)
ContainerBuilder
Scrollable container. ScrollState
scrollbar(state)
()
Render scrollbar track for a ScrollState
bordered(border)
ContainerBuilder
Shorthand for container().border(border)
modal(f)
Response
Modal overlay with dimmed background
overlay(f)
Response
Floating overlay (no dimming)
tooltip(text)
()
Hover tooltip near cursor
group(name)
ContainerBuilder
Named group for shared hover/focus styling
screen(name, &mut screens, f)
()
Conditional rendering when named screen is active. Hook-isolated. ScreenState
Scrollable styled log viewer. RichLogState::new() is bounded at RichLogState::DEFAULT_MAX_ENTRIES (10,000 entries) — older entries drop from the front. Use RichLogState::new_unbounded() only when growth is bounded elsewhere.
Runtime & Hooks
These are not widgets but essential Context methods for state, input, and environment.
State management
Method
Returns
Description
use_state(init)
State<T>
Persistent state across frames. Read with .get(ui), mutate with .get_mut(ui)
use_memo(deps, compute)
&T
Memoized computation, recomputes when deps changes
Focus & interaction
Method
Returns
Description
register_focusable()
bool
Register current widget as focusable, returns whether it has focus
interaction()
Response
Get click/hover Response for current interaction slot
widget(w)
W::Response
Render a custom Widget trait implementor
error_boundary(f)
—
Catch panics in closure, render error message. Variant: error_boundary_with(f, fallback)
focus_index()
usize
Current focus index
set_focus_index(index)
—
Set focus index programmatically
focus_count()
usize
Total focusable widget count
Keyboard input
Method
Returns
Description
key(c)
bool
Char key pressed (non-consuming)
key_code(code)
bool
KeyCode pressed (non-consuming)
raw_key_code(code)
bool
KeyCode pressed, ignoring consumed state
consume_key(c)
bool
Char key pressed (marks as consumed)
consume_key_code(code)
bool
KeyCode pressed (marks as consumed)
key_mod(c, mods)
bool
Char + modifier (Ctrl, Alt, Shift)
raw_key_mod(c, mods)
bool
Char + modifier, ignoring consumed state
key_chord(seq)
bool
Cross-frame multi-key sequence (vi gg, leader keys); buffers partial input and times out on inactivity
key_chord_timeout(seq, ticks)
bool
key_chord with an explicit per-call timeout in ticks
.push(text, style), .entries, .auto_scroll, .max_entries: Option<usize>. ::new() caps at 10,000; ::new_unbounded() opts out (use only when growth is bounded elsewhere).
Most size/spacing methods have breakpoint variants: _xs, _sm, _md, _lg, _xl, _at(breakpoint).
Example: .w_sm(40) sets width to 40 only at the Sm breakpoint.
Finalization
Method
Description
.col(f)
Render as vertical container, returns Response
.row(f)
Render as horizontal container, returns Response
.draw(f)
Raw buffer access. Closure: FnOnce(&mut Buffer, Rect) + 'static
.apply(style)
Apply a ContainerStyle struct
CanvasContext Quick Reference
Received in ui.canvas(w, h, |cv| { ... }). Coordinates are in pixel space (cols2 x rows4 braille resolution).
Method
Description
.width() / .height()
Pixel dimensions
.dot(x, y)
Set single pixel
.line(x0, y0, x1, y1)
Bresenham line
.rect(x, y, w, h)
Rectangle outline
.filled_rect(x, y, w, h)
Filled rectangle
.circle(cx, cy, r)
Circle outline
.filled_circle(cx, cy, r)
Filled circle
.triangle(x0, y0, x1, y1, x2, y2)
Triangle outline
.filled_triangle(x0, y0, x1, y1, x2, y2)
Filled triangle
.points(pts)
Multiple dots from &[(usize, usize)]
.polyline(pts)
Connected line segments from &[(usize, usize)]
.print(x, y, text)
Text label overlay at pixel position
.set_color(color) / .color()
Set/get drawing color
.layer()
Start a new z-layer (later layers overlay earlier ones)