pub struct Frame<'a> { /* private fields */ }Implementations§
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn paint_system_icon(
&mut self,
bounds: Rect,
icon: SystemIcon,
color: Color,
)
pub fn paint_system_icon( &mut self, bounds: Rect, icon: SystemIcon, color: Color, )
Paint a bundled high-resolution Material Symbols Outlined system icon tinted to color.
On GLES backends, renders directly from the embedded 48x48 MSDF texture for resolution- independent vector sharpness at any display scale or zoom level.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn scroll_stretch(&self, id: u64) -> (f32, f32)
pub fn scroll_stretch(&self, id: u64) -> (f32, f32)
Current Android 12/13 EdgeEffect stretch (scale_factor, edge_sign) for a scroll viewport.
Sourcepub fn with_edge_stretch(
&mut self,
bounds: Rect,
horizontal: bool,
stretch_scale: f32,
edge_sign: f32,
build: impl FnOnce(&mut Self),
)
pub fn with_edge_stretch( &mut self, bounds: Rect, horizontal: bool, stretch_scale: f32, edge_sign: f32, build: impl FnOnce(&mut Self), )
Apply Android 12/13 EdgeEffect (TYPE_STRETCH) vertical or horizontal stretch transform
anchored at the start edge (edge_sign > 0) or end edge (edge_sign < 0).
No-op when stretch_scale <= 1.0005 (zero transform overhead at rest).
Sourcepub fn scroll_viewport(
&mut self,
id: u64,
b: Rect,
offset: &mut f32,
max: f32,
) -> bool
pub fn scroll_viewport( &mut self, id: u64, b: Rect, offset: &mut f32, max: f32, ) -> bool
Touch/fling handling shared by clipped scroll containers. Wheel input is already normalized by the platform adapter; no second easing is applied.
Sourcepub fn cancel_scroll(&mut self, id: u64)
pub fn cancel_scroll(&mut self, id: u64)
Stop any touch drag or fling owned by this viewport before external scrolling.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn alert(
&mut self,
id: u64,
message: &str,
severity: AlertSeverity,
) -> Response
pub fn alert( &mut self, id: u64, message: &str, severity: AlertSeverity, ) -> Response
Dismissible inline alert; application state owns whether it is shown.
Sourcepub fn alert_with_options(
&mut self,
id: u64,
message: &str,
severity: AlertSeverity,
options: AlertOptions<'_>,
) -> (Response, bool)
pub fn alert_with_options( &mut self, id: u64, message: &str, severity: AlertSeverity, options: AlertOptions<'_>, ) -> (Response, bool)
Inline alert supporting Standard, Filled, and Outlined variants, an optional
custom trailing action button, and optional dismiss button.
Returns (dismiss_response, action_clicked).
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn top_app_bar_scroll_input(
&mut self,
bounds: Rect,
state: &mut TopAppBarState,
variant: TopAppBarVariant,
behavior: TopAppBarScrollBehavior,
content_offset: &mut f32,
content_max: f32,
) -> f32
pub fn top_app_bar_scroll_input( &mut self, bounds: Rect, state: &mut TopAppBarState, variant: TopAppBarVariant, behavior: TopAppBarScrollBehavior, content_offset: &mut f32, content_max: f32, ) -> f32
Route wheel and touch-drag input from a content viewport into a top app bar and its caller-owned scroll offset. A drag remains captured after leaving the viewport and is cancelled on blur or pointer cancellation.
Sourcepub fn top_app_bar_scroll_keyboard(
&mut self,
target_id: u64,
bounds: Rect,
state: &mut TopAppBarState,
variant: TopAppBarVariant,
behavior: TopAppBarScrollBehavior,
content_offset: &mut f32,
content_max: f32,
) -> f32
pub fn top_app_bar_scroll_keyboard( &mut self, target_id: u64, bounds: Rect, state: &mut TopAppBarState, variant: TopAppBarVariant, behavior: TopAppBarScrollBehavior, content_offset: &mut f32, content_max: f32, ) -> f32
Route arrow, Page Up/Down, Home and End keys while the scroll target has focus. Returns the delta consumed by the bar and content.
Sourcepub fn top_app_bar(
&mut self,
id: u64,
title: &str,
variant: TopAppBarVariant,
state: &TopAppBarState,
navigation: Option<AppBarAction<'_>>,
actions: &[AppBarAction<'_>],
rtl: bool,
) -> Option<usize>
pub fn top_app_bar( &mut self, id: u64, title: &str, variant: TopAppBarVariant, state: &TopAppBarState, navigation: Option<AppBarAction<'_>>, actions: &[AppBarAction<'_>], rtl: bool, ) -> Option<usize>
Material-inspired app bar. Action 0 is navigation; later actions are indexed from one. Scroll offsets are supplied by the caller.
Sourcepub fn top_app_bar_with_icons(
&mut self,
id: u64,
title: &str,
variant: TopAppBarVariant,
state: &TopAppBarState,
navigation: Option<AppBarAction<'_>>,
actions: &[AppBarAction<'_>],
rtl: bool,
icons: &[Option<AppBarIcon>],
) -> Option<usize>
pub fn top_app_bar_with_icons( &mut self, id: u64, title: &str, variant: TopAppBarVariant, state: &TopAppBarState, navigation: Option<AppBarAction<'_>>, actions: &[AppBarAction<'_>], rtl: bool, icons: &[Option<AppBarIcon>], ) -> Option<usize>
Icon entries correspond to navigation followed by the trailing actions; missing entries fall back to the caller-provided glyph.
Sourcepub fn bottom_app_bar_scroll_input(
&mut self,
target_id: u64,
bounds: Rect,
bar: &mut BottomAppBarState,
behavior: BottomAppBarScrollBehavior,
scroll: &mut TopAppBarState,
content_offset: &mut f32,
content_max: f32,
bar_height: f32,
) -> f32
pub fn bottom_app_bar_scroll_input( &mut self, target_id: u64, bounds: Rect, bar: &mut BottomAppBarState, behavior: BottomAppBarScrollBehavior, scroll: &mut TopAppBarState, content_offset: &mut f32, content_max: f32, bar_height: f32, ) -> f32
Route scrolling for a bottom bar and settle after a touch gesture or its content fling completes. Keyboard and wheel deltas remain direct.
Sourcepub fn scrolling_bottom_app_bar(
&mut self,
id: u64,
viewport: Rect,
state: &BottomAppBarState,
actions: &[AppBarAction<'_>],
icons: &[Option<AppBarIcon>],
fab: Option<(AppBarAction<'_>, Option<AppBarIcon>)>,
rtl: bool,
) -> Option<usize>
pub fn scrolling_bottom_app_bar( &mut self, id: u64, viewport: Rect, state: &BottomAppBarState, actions: &[AppBarAction<'_>], icons: &[Option<AppBarIcon>], fab: Option<(AppBarAction<'_>, Option<AppBarIcon>)>, rtl: bool, ) -> Option<usize>
Draw an anchored bar within a clipped viewport using the current scroll offset. Fully hidden actions are removed from the focus order.
Sourcepub fn scrolling_bottom_app_bar_with_overflow(
&mut self,
id: u64,
viewport: Rect,
bar: &BottomAppBarState,
menu: &mut BottomAppBarOverflowState,
actions: &[AppBarAction<'_>],
icons: &[Option<AppBarIcon>],
fab: Option<(AppBarAction<'_>, Option<AppBarIcon>)>,
rtl: bool,
) -> Option<usize>
pub fn scrolling_bottom_app_bar_with_overflow( &mut self, id: u64, viewport: Rect, bar: &BottomAppBarState, menu: &mut BottomAppBarOverflowState, actions: &[AppBarAction<'_>], icons: &[Option<AppBarIcon>], fab: Option<(AppBarAction<'_>, Option<AppBarIcon>)>, rtl: bool, ) -> Option<usize>
Bottom bar with a discoverable overflow menu. The returned index uses
the original action order; the FAB, including when overflowed, is
actions.len(). Supports up to 64 actions and a viewport at least
56 dp wide; the menu is independently scrollable when necessary.
Sourcepub fn bottom_app_bar_at(
&mut self,
id: u64,
bounds: Rect,
actions: &[AppBarAction<'_>],
icons: &[Option<AppBarIcon>],
fab: Option<(AppBarAction<'_>, Option<AppBarIcon>)>,
rtl: bool,
) -> Option<usize>
pub fn bottom_app_bar_at( &mut self, id: u64, bounds: Rect, actions: &[AppBarAction<'_>], icons: &[Option<AppBarIcon>], fab: Option<(AppBarAction<'_>, Option<AppBarIcon>)>, rtl: bool, ) -> Option<usize>
Draw an 80 dp bottom app bar in caller-supplied bounds. The optional FAB
sits at the logical end; the return index is actions.len() for it.
Actions that cannot fit are omitted rather than overlapping the FAB.
Sourcepub fn top_app_bar_at(
&mut self,
id: u64,
bounds: Rect,
title: &str,
centered: bool,
navigation: Option<TopAppBarMaterialAction<'_>>,
actions: &[TopAppBarMaterialAction<'_>],
) -> Option<usize>
pub fn top_app_bar_at( &mut self, id: u64, bounds: Rect, title: &str, centered: bool, navigation: Option<TopAppBarMaterialAction<'_>>, actions: &[TopAppBarMaterialAction<'_>], ) -> Option<usize>
Positioned Top App Bar using official MaterialIcon buttons.
Returns Some(0) if the navigation icon was clicked, or Some(1 + i) for trailing action i.
Sourcepub fn top_app_bar_collapsing(
&mut self,
id: u64,
bounds: Rect,
title: &str,
expanded_h: f32,
collapsed_h: f32,
scroll_y: f32,
back_icon: Option<MaterialIcon>,
) -> (f32, bool)
pub fn top_app_bar_collapsing( &mut self, id: u64, bounds: Rect, title: &str, expanded_h: f32, collapsed_h: f32, scroll_y: f32, back_icon: Option<MaterialIcon>, ) -> (f32, bool)
Continuous scale-glide Collapsing Top App Bar (CollapsingToolbarLayout pattern):
smoothly collapses from expanded_h to collapsed_h as scroll_y increases while a
single title scales continuously (32sp -> 20sp) and glides diagonally beside the back button.
Returns (current_bar_height, back_clicked).
Sourcepub fn floating_pill_app_bar(
&mut self,
id: u64,
bounds: Rect,
slots: &[FloatingPillSlot<'_>],
custom_slot: impl FnMut(&mut Self, usize, Rect),
) -> Option<usize>
pub fn floating_pill_app_bar( &mut self, id: u64, bounds: Rect, slots: &[FloatingPillSlot<'_>], custom_slot: impl FnMut(&mut Self, usize, Rect), ) -> Option<usize>
Floating primary-filled pill app bar with elevation shadow, icon buttons, and optional
custom brand slot (invoked whenever slot.icon is None).
Returns the clicked slot index, if any.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn autocomplete(
&mut self,
id: u64,
label: &str,
query: &str,
suggestions: &[&str],
open: &mut bool,
options: AutocompleteOptions,
) -> (Response, Option<usize>)
pub fn autocomplete( &mut self, id: u64, label: &str, query: &str, suggestions: &[&str], open: &mut bool, options: AutocompleteOptions, ) -> (Response, Option<usize>)
Material Autocomplete text field with an elevated filtered suggestion list.
Returns (field_response, selected_option_index) when a suggestion is clicked.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn avatar_at(
&mut self,
bounds: Rect,
shape: AvatarShape,
content: AvatarContent<'_>,
)
pub fn avatar_at( &mut self, bounds: Rect, shape: AvatarShape, content: AvatarContent<'_>, )
Paint an image, initials or the Material person fallback inside an avatar shape. The caller owns image loading and chooses fallback content on failure.
Sourcepub fn avatar_group_with_options(
&mut self,
items: &[AvatarContent<'_>],
options: AvatarGroupOptions,
) -> AvatarGroupCounts
pub fn avatar_group_with_options( &mut self, items: &[AvatarContent<'_>], options: AvatarGroupOptions, ) -> AvatarGroupCounts
Draw a group using MUI’s max/total counting and caller-owned avatar content. Only visible members generate drawing commands, even for a very large group.
Sourcepub fn avatar_group(&mut self, labels: &[&str], visible: usize)
pub fn avatar_group(&mut self, labels: &[&str], visible: usize)
Draw overlapping initial avatars and an optional surplus count.
Source§impl Frame<'_>
impl Frame<'_>
pub fn badge(&mut self, label: &str)
Sourcepub fn badge_at(
&mut self,
owner: u64,
icon: Rect,
content: BadgeContent<'_>,
description: &str,
rtl: bool,
) -> bool
pub fn badge_at( &mut self, owner: u64, icon: Rect, content: BadgeContent<'_>, description: &str, rtl: bool, ) -> bool
Overlay a Material badge on an icon without changing its layout or
adding a focus target. Call after the owner so its semantics can receive
the localized description; rtl mirrors the placement.
Sourcepub fn badge_at_gravity(
&mut self,
owner: u64,
icon: Rect,
content: BadgeContent<'_>,
description: &str,
gravity: BadgeGravity,
rtl: bool,
) -> bool
pub fn badge_at_gravity( &mut self, owner: u64, icon: Rect, content: BadgeContent<'_>, description: &str, gravity: BadgeGravity, rtl: bool, ) -> bool
Overlay a badge at a logical corner; start and end mirror in RTL.
Sourcepub fn badge_at_with_options(
&mut self,
owner: u64,
icon: Rect,
content: BadgeContent<'_>,
description: &str,
options: BadgeOptions,
) -> bool
pub fn badge_at_with_options( &mut self, owner: u64, icon: Rect, content: BadgeContent<'_>, description: &str, options: BadgeOptions, ) -> bool
Overlay a badge with logical corner and offsets toward the icon center.
Source§impl Frame<'_>
impl Frame<'_>
Material inline Banner that reveals/collapses smoothly and returns the clicked action index (0..actions.len()).
Material inline Banner with optional leading MaterialIcon and action buttons.
Source§impl Frame<'_>
impl Frame<'_>
Horizontal clickable breadcrumb trail (Home › Settings › Display).
Returns the clicked segment index when any ancestor or leaf is clicked.
Source§impl Frame<'_>
impl Frame<'_>
An accessible icon button using bundled official Material Symbols geometry.
The glyph is presentation; label names the action for assistive technology.
Material icon button placed at caller-supplied bounds using a bundled MaterialIcon.
Pill button with Beer CSS / Material hover-wave effect.
Source§impl Frame<'_>
impl Frame<'_>
Equal-width connected toggle buttons with 2dp spacing. Selection stays with the caller; returns the activated index. The caller supplies at least 48dp per target. A group may contain at most 32 items.
Connected selection group with logical order mirrored for right-to-left layouts.
Standard equal-width action group. Returns the activated child index. The caller must provide enough room for 48dp targets and 12dp gaps.
Standard group with logical action order mirrored in right-to-left layouts.
Standard group with optional decorative 20dp Material icons preceding labels. Missing icon entries are treated as text-only actions.
Standard group with an anchored overflow menu. Action IDs remain logical. Requires at least a 48dp target, at most 32 actions, and reserves 66 IDs.
Standard overflow group retaining optional icons on visible and menu actions.
Connected single- or multi-selection group with an anchored overflow menu.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn card(
&mut self,
id: u64,
bounds: Rect,
label: &str,
options: CardOptions,
build: impl FnOnce(&mut Self),
) -> Option<Response>
pub fn card( &mut self, id: u64, bounds: Rect, label: &str, options: CardOptions, build: impl FnOnce(&mut Self), ) -> Option<Response>
Paint a passive or actionable card around caller-provided content. Child targets are processed first, so nested action clicks do not also activate an enclosing actionable card.
Sourcepub fn card_with_dragged(
&mut self,
id: u64,
bounds: Rect,
label: &str,
options: CardOptions,
dragged: bool,
build: impl FnOnce(&mut Self),
) -> Option<Response>
pub fn card_with_dragged( &mut self, id: u64, bounds: Rect, label: &str, options: CardOptions, dragged: bool, build: impl FnOnce(&mut Self), ) -> Option<Response>
Paint a card with the caller-owned Material dragged state.
Sourcepub fn card_with_state(
&mut self,
id: u64,
bounds: Rect,
label: &str,
options: CardOptions,
state: CardVisualState,
build: impl FnOnce(&mut Self),
) -> Option<Response>
pub fn card_with_state( &mut self, id: u64, bounds: Rect, label: &str, options: CardOptions, state: CardVisualState, build: impl FnOnce(&mut Self), ) -> Option<Response>
Paint caller-controlled checked and dragged card states.
Sourcepub fn swipe_dismiss_box(
&mut self,
id: u64,
bounds: Rect,
state: &mut SwipeDismissState,
top_radius: f32,
bottom_radius: f32,
build: impl FnOnce(&mut Self, Rect),
) -> bool
pub fn swipe_dismiss_box( &mut self, id: u64, bounds: Rect, state: &mut SwipeDismissState, top_radius: f32, bottom_radius: f32, build: impl FnOnce(&mut Self, Rect), ) -> bool
Horizontal swipe-to-dismiss card container with asymmetric top/bottom corner radii,
opacity fade during drag, threshold commit, and smooth spring return when released early.
Returns true on the frame the item is dismissed.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn carousel_pages(
&mut self,
bounds: Rect,
count: usize,
state: &mut CarouselState,
render: impl FnMut(&mut Self, usize, Rect),
)
pub fn carousel_pages( &mut self, bounds: Rect, count: usize, state: &mut CarouselState, render: impl FnMut(&mut Self, usize, Rect), )
Render interactive, viewport-wide custom pages with a shared drag and snap controller. A horizontal drag cancels child activation. A vertical drag stays available to the containing scroll view. The caller renders page contents and indicators.
Sourcepub fn carousel(
&mut self,
id: u64,
bounds: Rect,
items: &[CarouselItem<'_>],
state: &mut CarouselState,
options: CarouselOptions,
) -> Option<usize>
pub fn carousel( &mut self, id: u64, bounds: Rect, items: &[CarouselItem<'_>], state: &mut CarouselState, options: CarouselOptions, ) -> Option<usize>
A bounded, virtualized uncontained or full-screen carousel. Items are independently actionable; a drag cancels the pressed item’s activation.
Sourcepub fn carousel_named(
&mut self,
id: u64,
bounds: Rect,
items: &[CarouselItem<'_>],
state: &mut CarouselState,
options: CarouselOptions,
label: &str,
) -> Option<usize>
pub fn carousel_named( &mut self, id: u64, bounds: Rect, items: &[CarouselItem<'_>], state: &mut CarouselState, options: CarouselOptions, label: &str, ) -> Option<usize>
A carousel with a caller-provided accessible region name.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn chat_bubble(&mut self, message: ChatMessage<'_>)
pub fn chat_bubble(&mut self, message: ChatMessage<'_>)
Render one incoming or outgoing Material chat message bubble with wrapped body text and optional timestamp.
Source§impl Frame<'_>
impl Frame<'_>
pub fn checkbox( &mut self, id: u64, label: &str, value: &mut CheckState, enabled: bool, ) -> Response
Sourcepub fn checkbox_with_error(
&mut self,
id: u64,
label: &str,
value: &mut CheckState,
enabled: bool,
error: bool,
) -> Response
pub fn checkbox_with_error( &mut self, id: u64, label: &str, value: &mut CheckState, enabled: bool, error: bool, ) -> Response
Tri-state checkbox with an independent error visual state. The caller supplies an accessible explanation alongside the control.
Sourcepub fn checkbox_bool(
&mut self,
id: u64,
label: &str,
value: &mut bool,
enabled: bool,
) -> Response
pub fn checkbox_bool( &mut self, id: u64, label: &str, value: &mut bool, enabled: bool, ) -> Response
Binary checkbox; the mixed state is never introduced by this API.
Source§impl Frame<'_>
impl Frame<'_>
pub fn chip( &mut self, id: u64, label: &str, selected: bool, enabled: bool, ) -> Response
Sourcepub fn chip_with_options(
&mut self,
id: u64,
label: &str,
options: ChipOptions,
) -> (Response, bool)
pub fn chip_with_options( &mut self, id: u64, label: &str, options: ChipOptions, ) -> (Response, bool)
Material 3 chip supporting Assist, Filter, Input, and Suggestion variants,
flat or elevated surfaces, and an optional interactive trailing close button.
Returns (chip_response, close_clicked).
Source§impl Frame<'_>
impl Frame<'_>
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn command_palette_inline(
&mut self,
id: u64,
query: &mut String,
items: &[CommandItem<'_>],
placeholder: &str,
) -> Option<usize>
pub fn command_palette_inline( &mut self, id: u64, query: &mut String, items: &[CommandItem<'_>], placeholder: &str, ) -> Option<usize>
Inline searchable command list with filter field, shortcut badges, and Clear button. Returns the original index of the activated command, if any.
Sourcepub fn command_palette(
&mut self,
id: u64,
overlay: &mut OverlayState,
query: &mut String,
items: &[CommandItem<'_>],
placeholder: &str,
) -> Option<usize>
pub fn command_palette( &mut self, id: u64, overlay: &mut OverlayState, query: &mut String, items: &[CommandItem<'_>], placeholder: &str, ) -> Option<usize>
Modal Command Palette dialog overlay centered near the top of the viewport.
Returns the activated command index (and closes overlay) when an item is chosen.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn data_table(
&mut self,
id: u64,
columns: &[TableColumn<'_>],
row_count: usize,
sort: &mut TableSortState,
cell_text: impl FnMut(usize, usize) -> String,
) -> bool
pub fn data_table( &mut self, id: u64, columns: &[TableColumn<'_>], row_count: usize, sort: &mut TableSortState, cell_text: impl FnMut(usize, usize) -> String, ) -> bool
Material DataTable with clickable sortable column headers, sort direction arrows,
and 1dp row dividers. Returns true when sort changed.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn calendar_grid(
&mut self,
id: u64,
state: &mut DatePickerState,
range: bool,
) -> bool
pub fn calendar_grid( &mut self, id: u64, state: &mut DatePickerState, range: bool, ) -> bool
Inline Material calendar grid supporting single-date or date-range selection,
month/year/24-year drilldown, range hover preview, and roving arrow-key navigation.
Returns true when the selected date/range changed.
Sourcepub fn calendar_grid_with_options(
&mut self,
id: u64,
state: &mut DatePickerState,
range: bool,
options: DatePickerOptions,
is_disabled: impl Fn([i32; 3]) -> bool,
) -> bool
pub fn calendar_grid_with_options( &mut self, id: u64, state: &mut DatePickerState, range: bool, options: DatePickerOptions, is_disabled: impl Fn([i32; 3]) -> bool, ) -> bool
Inline Material calendar grid with optional text-input mode, min_date/max_date bounds,
and a caller-supplied is_disabled predicate for blacked-out dates.
Sourcepub fn date_range_picker_dual(
&mut self,
id: u64,
state: &mut DatePickerState,
options: DatePickerOptions,
is_disabled: impl Fn([i32; 3]) -> bool + Copy,
) -> bool
pub fn date_range_picker_dual( &mut self, id: u64, state: &mut DatePickerState, options: DatePickerOptions, is_disabled: impl Fn([i32; 3]) -> bool + Copy, ) -> bool
Dual-month side-by-side calendar range picker displaying (state.year, state.month)
alongside the consecutive following month for cross-month range selection.
Sourcepub fn date_picker(
&mut self,
id: u64,
label: &str,
state: &mut DatePickerState,
filled: bool,
) -> bool
pub fn date_picker( &mut self, id: u64, label: &str, state: &mut DatePickerState, filled: bool, ) -> bool
Date picker field paired with an anchored calendar popup overlay.
Returns true when the selected date changed.
Sourcepub fn date_range_picker(
&mut self,
id: u64,
label: &str,
state: &mut DatePickerState,
filled: bool,
) -> bool
pub fn date_range_picker( &mut self, id: u64, label: &str, state: &mut DatePickerState, filled: bool, ) -> bool
Date-range picker field paired with an anchored calendar popup overlay.
Returns true when the selected range changed.
Source§impl Frame<'_>
impl Frame<'_>
pub fn divider(&mut self)
Sourcepub fn divider_at(
&mut self,
bounds: Rect,
orientation: DividerOrientation,
inset_start: f32,
inset_end: f32,
)
pub fn divider_at( &mut self, bounds: Rect, orientation: DividerOrientation, inset_start: f32, inset_end: f32, )
Draw a 1dp decorative divider centered on its short axis. Insets are physical distances along the long axis; callers handle RTL placement.
Sourcepub fn divider_styled_at(&mut self, bounds: Rect, options: DividerOptions)
pub fn divider_styled_at(&mut self, bounds: Rect, options: DividerOptions)
Draw a divider with logical horizontal insets and an explicit thickness. Vertical insets run from top to bottom regardless of layout direction.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn empty_state(
&mut self,
id: u64,
title: &str,
message: &str,
options: EmptyStateOptions<'_>,
) -> Option<Response>
pub fn empty_state( &mut self, id: u64, title: &str, message: &str, options: EmptyStateOptions<'_>, ) -> Option<Response>
Centered empty or error state panel with heading, supporting message, optional icon,
and optional action button. Returns Some(Response) when an action button is shown.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn expansion_panel(
&mut self,
id: u64,
title: &str,
description: &str,
expanded: &mut bool,
body_height: f32,
options: ExpansionPanelOptions,
body: impl FnOnce(&mut Self),
) -> Response
pub fn expansion_panel( &mut self, id: u64, title: &str, description: &str, expanded: &mut bool, body_height: f32, options: ExpansionPanelOptions, body: impl FnOnce(&mut Self), ) -> Response
Material ExpansionPanel with animated collapse/expand height, rotating chevron, and independent top/bottom corner rounding for stacked accordions.
Source§impl Frame<'_>
impl Frame<'_>
pub fn fab( &mut self, id: u64, label: &str, glyph: &str, size: f32, extended: bool, enabled: bool, ) -> Response
Sourcepub fn fab_with_icon(
&mut self,
id: u64,
label: &str,
icon: AppBarIcon,
size: f32,
extended: bool,
enabled: bool,
) -> Response
pub fn fab_with_icon( &mut self, id: u64, label: &str, icon: AppBarIcon, size: f32, extended: bool, enabled: bool, ) -> Response
FAB with a bundled Material icon; extended width hugs its icon and label.
Sourcepub fn fab_with_icon_direction(
&mut self,
id: u64,
label: &str,
icon: AppBarIcon,
size: f32,
extended: bool,
enabled: bool,
rtl: bool,
) -> Response
pub fn fab_with_icon_direction( &mut self, id: u64, label: &str, icon: AppBarIcon, size: f32, extended: bool, enabled: bool, rtl: bool, ) -> Response
FAB with logical leading icon and trailing label for left- or right-to-left layouts.
pub fn fab_with_options( &mut self, id: u64, label: &str, icon: AppBarIcon, options: FabOptions, ) -> Response
Sourcepub fn fab_at(
&mut self,
id: u64,
bounds: Rect,
icon: MaterialIcon,
label: &str,
options: FabOptions,
) -> Response
pub fn fab_at( &mut self, id: u64, bounds: Rect, icon: MaterialIcon, label: &str, options: FabOptions, ) -> Response
Floating Action Button placed at caller-supplied bounds (for anchored viewport placement).
Sourcepub fn fab_at_animated(
&mut self,
id: u64,
anchor_bounds: Rect,
icon: MaterialIcon,
label: &str,
options: FabOptions,
) -> Response
pub fn fab_at_animated( &mut self, id: u64, anchor_bounds: Rect, icon: MaterialIcon, label: &str, options: FabOptions, ) -> Response
Anchored MaterialIcon FAB whose width smoothly animates between collapsed (size × size)
and extended (icon + label) right- or left-aligned inside anchor_bounds.
Source§impl Frame<'_>
impl Frame<'_>
FAB with up to eight labeled actions expanding above it.
FAB menu with logical direction and scrollable constrained-height items.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn grid_list(
&mut self,
id: u64,
items: &[GridListItem<'_>],
selected: Option<usize>,
options: GridListOptions,
) -> Option<usize>
pub fn grid_list( &mut self, id: u64, items: &[GridListItem<'_>], selected: Option<usize>, options: GridListOptions, ) -> Option<usize>
Material Grid List / Image List rendering responsive multi-column tiles with optional cover image, centered icon, bottom caption scrim, and selection highlight. Returns the clicked tile index, if any.
Source§impl Frame<'_>
impl Frame<'_>
pub fn viewport(&self) -> Rect
pub fn without_input(&mut self, blocked: bool, build: impl FnOnce(&mut Self))
Sourcepub fn without_pointer_input<R>(
&mut self,
blocked: bool,
build: impl FnOnce(&mut Self) -> R,
) -> R
pub fn without_pointer_input<R>( &mut self, blocked: bool, build: impl FnOnce(&mut Self) -> R, ) -> R
Block only pointer and wheel input (preserving keyboard focus and key events) when a higher-z sibling or clickable descendant owns the pointer location.
Sourcepub fn cancel_pointer_input<R>(
&mut self,
cancelled: bool,
build: impl FnOnce(&mut Self) -> R,
) -> R
pub fn cancel_pointer_input<R>( &mut self, cancelled: bool, build: impl FnOnce(&mut Self) -> R, ) -> R
Cancel active child pointer capture when a parent gesture (e.g. scroll/drag) takes over:
clears active so releasing cannot trigger a click, while letting already-started
Material ripples fade out smoothly (ACTION_CANCEL semantics).
pub fn paint_rect(&mut self, bounds: Rect, radius: f32, color: Color)
Sourcepub fn paint_image(
&mut self,
bounds: Rect,
image: &Image,
fit: ImageFit,
radius: f32,
) -> bool
pub fn paint_image( &mut self, bounds: Rect, image: &Image, fit: ImageFit, radius: f32, ) -> bool
Draw a caller-owned RGBA image with centered cover/contain geometry.
Sourcepub fn paint_tinted_image(
&mut self,
bounds: Rect,
image: &Image,
fit: ImageFit,
radius: f32,
color: Color,
) -> bool
pub fn paint_tinted_image( &mut self, bounds: Rect, image: &Image, fit: ImageFit, radius: f32, color: Color, ) -> bool
Draw a caller-owned RGBA or MSDF image tinted by color.
Sourcepub fn paint_shape(&mut self, bounds: Rect, index: usize, color: Color) -> bool
pub fn paint_shape(&mut self, bounds: Rect, index: usize, color: Color) -> bool
Paint one of the bundled static Beer CSS shapes, contained within bounds.
Sourcepub fn paint_ink(
&mut self,
bounds: Rect,
corner_radius: f32,
center: [f32; 2],
radius: f32,
color: Color,
)
pub fn paint_ink( &mut self, bounds: Rect, corner_radius: f32, center: [f32; 2], radius: f32, color: Color, )
Renderer-independent soft radial primitive. Stateful controls use ink internally.
Sourcepub fn wave(&mut self, response: Response, radius: f32, color: Color) -> f32
pub fn wave(&mut self, response: Response, radius: f32, color: Color) -> f32
Beer CSS’s centered hover wave: a 200ms expanding hard-edged state layer.
pub fn paint_line( &mut self, from: [f32; 2], to: [f32; 2], width: f32, color: Color, )
Sourcepub fn paint_arc(
&mut self,
bounds: Rect,
start: f32,
sweep: f32,
stroke: f32,
color: Color,
)
pub fn paint_arc( &mut self, bounds: Rect, start: f32, sweep: f32, stroke: f32, color: Color, )
Paint a circular arc with flat ends.
pub fn paint_text(&mut self, bounds: Rect, text: &str, color: Color)
pub fn action_at( &mut self, id: u64, bounds: Rect, label: &str, options: Options, ) -> Response
Sourcepub fn target(
&mut self,
id: u64,
bounds: Rect,
label: &str,
enabled: bool,
role: Role,
) -> Response
pub fn target( &mut self, id: u64, bounds: Rect, label: &str, enabled: bool, role: Role, ) -> Response
An interaction/semantic target for a composition with custom presentation.
pub fn target_roving( &mut self, id: u64, bounds: Rect, label: &str, enabled: bool, tab_stop: bool, ) -> Response
pub fn state_layer(&mut self, response: Response, radius: f32, color: Color)
pub fn effect( &mut self, id: u64, property: u8, target: f32, initial: f32, ) -> f32
Sourcepub fn spatial(
&mut self,
id: u64,
property: u8,
target: f32,
initial: f32,
) -> f32
pub fn spatial( &mut self, id: u64, property: u8, target: f32, initial: f32, ) -> f32
Bounded geometry transition using AndroidX Standard spatial spring tokens.
Sourcepub fn bottom_sheet_scroll_offset(&self) -> f32
pub fn bottom_sheet_scroll_offset(&self) -> f32
Scroll offset supplied while building a nested-scroll bottom sheet.
pub fn request_focus(&mut self, id: u64)
pub fn focused_id(&self) -> Option<u64>
Sourcepub fn keyboard_focused(&self, response: Response) -> bool
pub fn keyboard_focused(&self, response: Response) -> bool
Whether this response has a keyboard-visible focus state.
pub fn time(&self) -> f64
pub fn reduced_motion(&self) -> bool
pub fn wake_at(&mut self, deadline: f64)
pub fn continuous(&mut self, bounds: Rect) -> bool
pub fn pressed_key(&self, key: Key) -> bool
pub fn pointer_in(&self, bounds: Rect) -> bool
pub fn scroll_y(&self, bounds: Rect) -> f32
pub fn compact_action_at( &mut self, id: u64, bounds: Rect, label: &str, selected: bool, ) -> Response
Sourcepub fn paint_asym_rect(
&mut self,
rect: Rect,
top_radius: f32,
bottom_radius: f32,
color: Color,
)
pub fn paint_asym_rect( &mut self, rect: Rect, top_radius: f32, bottom_radius: f32, color: Color, )
Paint a rectangle with independent top and bottom corner radii without a center seam.
Sourcepub fn paint_rounded_screen_mask(
&mut self,
bounds: Rect,
corner_radius: f32,
outer_color: Color,
)
pub fn paint_rounded_screen_mask( &mut self, bounds: Rect, corner_radius: f32, outer_color: Color, )
Paint an anti-aliased 4-corner inverse rounded mask over bounds using outer_color.
Useful for clipping rectangular content to rounded viewport/bezel corners.
Sourcepub fn surface(&mut self, bounds: Rect, radius: f32, level: u8)
pub fn surface(&mut self, bounds: Rect, radius: f32, level: u8)
Paint a Material 3 tonal surface with elevation tint (background.mix(primary, 0.03 * level))
and drop shadow for level > 0.
Sourcepub fn mask_rounded_corners(&mut self, rect: Rect, radius: f32, bg: Color)
pub fn mask_rounded_corners(&mut self, rect: Rect, radius: f32, bg: Color)
Lightweight arc-based rounded corner clip mask using bg without allocating textures.
Useful for clipping arbitrary sub-viewports (e.g. thumbnails or cards).
Source§impl Frame<'_>
impl Frame<'_>
Paint a bundled Material navigation icon without adding a focus target.
Sourcepub fn paint_material_icon(
&mut self,
bounds: Rect,
icon: MaterialIcon,
color: Color,
)
pub fn paint_material_icon( &mut self, bounds: Rect, icon: MaterialIcon, color: Color, )
Paint an official Material Symbol inside its original 24dp design box.
The symbol is centered with its aspect ratio preserved within bounds.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn boxed(
&mut self,
height: f32,
radius: f32,
padding: f32,
background: Color,
build: impl FnOnce(&mut Self),
)
pub fn boxed( &mut self, height: f32, radius: f32, padding: f32, background: Color, build: impl FnOnce(&mut Self), )
Allocate a styled rectangular region and lay out children inside its padding.
Sourcepub fn container(
&mut self,
max_width: f32,
height: f32,
build: impl FnOnce(&mut Self),
)
pub fn container( &mut self, max_width: f32, height: f32, build: impl FnOnce(&mut Self), )
Center a child region up to a maximum width, keeping layout in caller control.
Sourcepub fn stack(
&mut self,
count: usize,
spacing: f32,
build: impl FnMut(&mut Self, usize),
)
pub fn stack( &mut self, count: usize, spacing: f32, build: impl FnMut(&mut Self, usize), )
Arrange children vertically using the given shared spacing.
Sourcepub fn grid(
&mut self,
count: usize,
columns: usize,
row_height: f32,
gap: f32,
build: impl FnMut(&mut Self, usize),
)
pub fn grid( &mut self, count: usize, columns: usize, row_height: f32, gap: f32, build: impl FnMut(&mut Self, usize), )
Lay out a bounded collection in equal-width columns with a shared gap.
pub fn reserve(&mut self, height: f32) -> Rect
pub fn paragraph( &mut self, bounds: Rect, text: &str, color: Color, style: TextStyle, line_height: f32, )
pub fn with_gap(&mut self, gap: f32, build: impl FnOnce(&mut Self))
pub fn row( &mut self, height: f32, columns: usize, build: impl FnMut(&mut Self, usize), )
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn preference_row_at(
&mut self,
id: u64,
bounds: Rect,
label: &str,
role: Role,
ink: Color,
content: impl FnOnce(&mut Self, Response),
) -> Response
pub fn preference_row_at( &mut self, id: u64, bounds: Rect, label: &str, role: Role, ink: Color, content: impl FnOnce(&mut Self, Response), ) -> Response
Place a preference row in explicit bounds. The target and state layer stay full size while the supplied content contracts during a press.
pub fn list_item( &mut self, id: u64, label: &str, selected: bool, enabled: bool, ) -> Response
pub fn selection_item( &mut self, id: u64, label: &str, selected: bool, enabled: bool, ) -> Response
Sourcepub fn virtual_list(
&mut self,
id: u64,
height: f32,
count: usize,
state: &mut ListState,
build: impl FnMut(&mut Self, usize, bool) -> Response,
) -> Response
pub fn virtual_list( &mut self, id: u64, height: f32, count: usize, state: &mut ListState, build: impl FnMut(&mut Self, usize, bool) -> Response, ) -> Response
Only calls build for visible rows. Use stable row IDs and one 40px list_item per row.
pub fn virtual_list_padded( &mut self, id: u64, height: f32, count: usize, state: &mut ListState, build: impl FnMut(&mut Self, usize, bool) -> Response, ) -> Response
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn virtual_grid(
&mut self,
id: u64,
height: f32,
columns: usize,
count: usize,
state: &mut ListState,
build: impl FnMut(&mut Self, usize, bool) -> Response,
) -> Response
pub fn virtual_grid( &mut self, id: u64, height: f32, columns: usize, count: usize, state: &mut ListState, build: impl FnMut(&mut Self, usize, bool) -> Response, ) -> Response
Fixed-cell grid; builds only visible cells and keeps selection by logical index.
Sourcepub fn list_item_two_line(
&mut self,
id: u64,
icon: Option<MaterialIcon>,
title: &str,
subtitle: &str,
show_chevron: bool,
enabled: bool,
) -> Response
pub fn list_item_two_line( &mut self, id: u64, icon: Option<MaterialIcon>, title: &str, subtitle: &str, show_chevron: bool, enabled: bool, ) -> Response
Two-line Material list/preference row with optional leading MaterialIcon, title,
secondary subtitle, and optional trailing chevron.
Source§impl Frame<'_>
impl Frame<'_>
pub fn loading_indicator( &mut self, id: u64, label: &str, state: &mut LoadingState, progress: Option<f32>, contained: bool, )
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn android_popup_item(
&mut self,
id: u64,
label: &str,
enabled: bool,
trailing: Option<MaterialIcon>,
) -> Response
pub fn android_popup_item( &mut self, id: u64, label: &str, enabled: bool, trailing: Option<MaterialIcon>, ) -> Response
Menu action: transparent rows share the panel surface, with immediate state layers. Android Material popup row: body-large text and an optional trailing symbol.
Menu item with a decorative Material icon at the logical leading edge.
Menu item with a leading checkmark when selected, retaining alignment for other items.
Source§impl Frame<'_>
impl Frame<'_>
Match printable keys against enabled menu labels while a menu item has focus.
IDs must be contiguous starting at first_id; callers reset the state on close.
Sourcepub fn select_typeahead(
&mut self,
state: &mut MenuTypeaheadState,
trigger_id: u64,
current: usize,
items: &[(&str, bool)],
) -> Option<usize>
pub fn select_typeahead( &mut self, state: &mut MenuTypeaheadState, trigger_id: u64, current: usize, items: &[(&str, bool)], ) -> Option<usize>
Match printable keys while a closed select trigger owns focus. The caller commits the returned option and resets the buffer on opening.
Source§impl Frame<'_>
Reusable Material navigation chrome with state layers and selection motion.
impl Frame<'_>
Reusable Material navigation chrome with state layers and selection motion.
A navigation drawer/rail row. Expansion is a continuous 0..1 value.
Sourcepub fn material_drawer_item(
&mut self,
id: u64,
bounds: Rect,
label: &str,
icon: MaterialIcon,
selected: bool,
enabled: bool,
) -> Response
pub fn material_drawer_item( &mut self, id: u64, bounds: Rect, label: &str, icon: MaterialIcon, selected: bool, enabled: bool, ) -> Response
Material Android NavigationView destination. bounds is the full 56dp row;
the indicator has 12dp horizontal insets and icons use a 24dp design box.
Standard 80dp bottom navigation destination, including animated indicator.
Source§impl Frame<'_>
impl Frame<'_>
Horizontal navigation destinations with caller-owned selection.
When always_show_labels is false, unselected icons move to the
center and their labels fade out. Accessible names remain available.
Optional built-in vector icons are matched by destination index. Missing entries use the destination’s caller-supplied glyph.
A compact vertical navigation rail. The caller may position it using
within; selection and all destination data remain caller-owned.
Narrow-to-wide rail with caller-owned expanded state. Geometry follows the current motion sample, including when the transition reverses.
Android Material 3 Expressive collapsed/expanded destination layout.
Sample the rail’s expansion once per frame to synchronize its header.
Draw a rail using a shared expansion sample from navigation_rail_expansion.
Expanded, non-modal rail with 56 dp horizontal destination rows. The enclosing application controls rail placement and expansion.
Material navigation drawer account/title header block.
Material navigation drawer section subheader label (14sp medium, 28dp horizontal inset).
Persistent Material navigation drawer surface hosting a vertical stack of destinations.
Returns true when *selected changed.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn overlay_item(
&mut self,
index: usize,
count: usize,
build: impl FnOnce(&mut Self),
)
pub fn overlay_item( &mut self, index: usize, count: usize, build: impl FnOnce(&mut Self), )
Source Web menu entry/exit stagger; each item retargets from its presentation.
pub fn overlay_section( &mut self, section: OverlaySection, build: impl FnOnce(&mut Self), )
Sourcepub fn overlay(
&mut self,
id: u64,
state: &mut OverlayState,
bounds: Rect,
modal: bool,
build: impl FnMut(&mut Self, &mut bool),
)
pub fn overlay( &mut self, id: u64, state: &mut OverlayState, bounds: Rect, modal: bool, build: impl FnMut(&mut Self, &mut bool), )
Modal surface: disable background while open, then call this after the trigger.
Exit visuals never receive input; focus is restored immediately on dismissal.
Sourcepub fn drag_handle(
&mut self,
id: u64,
b: Rect,
track: Rect,
label: &str,
value: &mut f32,
range: RangeInclusive<f32>,
vertical: bool,
) -> Response
pub fn drag_handle( &mut self, id: u64, b: Rect, track: Rect, label: &str, value: &mut f32, range: RangeInclusive<f32>, vertical: bool, ) -> Response
Direct manipulation handle: pointer movement has no animation lag.
Sourcepub fn standard_side_sheet(
&mut self,
id: u64,
open: &mut bool,
right_edge: bool,
width: f32,
build_content: impl FnOnce(&mut Self),
build_sheet: impl FnOnce(&mut Self),
)
pub fn standard_side_sheet( &mut self, id: u64, open: &mut bool, right_edge: bool, width: f32, build_content: impl FnOnce(&mut Self), build_sheet: impl FnOnce(&mut Self), )
Material 3 coplanar adaptive Standard Side Sheet sharing horizontal bounds with main content, separated by a 1dp vertical divider, with animated width.
Sourcepub fn dialog_chrome(
&mut self,
id: u64,
title: &str,
body: &str,
cancel_label: Option<&str>,
confirm_label: &str,
) -> (bool, bool)
pub fn dialog_chrome( &mut self, id: u64, title: &str, body: &str, cancel_label: Option<&str>, confirm_label: &str, ) -> (bool, bool)
Standard Material 3 dialog content layout (24sp title, body paragraph, Cancel/Confirm text actions).
Returns (cancel_clicked, confirm_clicked).
Sourcepub fn fullscreen_dialog_header(
&mut self,
id: u64,
title: &str,
action_label: &str,
) -> (bool, bool)
pub fn fullscreen_dialog_header( &mut self, id: u64, title: &str, action_label: &str, ) -> (bool, bool)
Material 3 Full-Screen Dialog header bar (Close X + 22sp title + Save action + divider).
Returns (close_clicked, action_clicked).
Sourcepub fn bottom_sheet_drag_handle(&mut self)
pub fn bottom_sheet_drag_handle(&mut self)
Centered Material 3 bottom sheet drag handle pill (32dp × 4dp, 22dp vertical touch margin).
Sourcepub fn side_sheet_header(&mut self, id: u64, title: &str) -> bool
pub fn side_sheet_header(&mut self, id: u64, title: &str) -> bool
Material 3 Side Sheet header row (22sp title + trailing Close icon button + bottom divider).
Returns true when the close button is clicked.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn pagination(
&mut self,
id: u64,
page: &mut usize,
count: usize,
enabled: bool,
)
pub fn pagination( &mut self, id: u64, page: &mut usize, count: usize, enabled: bool, )
Numbered pagination with a bounded number of visible items. Values are one-based.
Sourcepub fn pagination_with_options(
&mut self,
id: u64,
page: &mut usize,
count: usize,
enabled: bool,
options: PaginationOptions,
)
pub fn pagination_with_options( &mut self, id: u64, page: &mut usize, count: usize, enabled: bool, options: PaginationOptions, )
Numbered pagination with configurable boundary/sibling counts and optional First/Last buttons.
Sourcepub fn paginator(
&mut self,
id: u64,
page: &mut usize,
page_size: usize,
total_items: usize,
enabled: bool,
) -> bool
pub fn paginator( &mut self, id: u64, page: &mut usize, page_size: usize, total_items: usize, enabled: bool, ) -> bool
Angular/Material Paginator bar ("X – Y of N" range readout + Previous/Next buttons).
Returns true when *page changed.
Sourcepub fn paginator_with_page_size(
&mut self,
id: u64,
page: &mut usize,
page_size: &mut usize,
page_size_options: &[usize],
total_items: usize,
enabled: bool,
) -> bool
pub fn paginator_with_page_size( &mut self, id: u64, page: &mut usize, page_size: &mut usize, page_size_options: &[usize], total_items: usize, enabled: bool, ) -> bool
Angular/Material Paginator bar with optional page-size selector ("Items per page: N"),
range readout ("X – Y of N"), and Previous/Next buttons.
Returns true when *page or *page_size changed.
Sourcepub fn page_indicator(
&mut self,
id: u64,
bounds: Rect,
page_count: usize,
current: f32,
options: PageIndicatorOptions,
) -> Option<usize>
pub fn page_indicator( &mut self, id: u64, bounds: Rect, page_count: usize, current: f32, options: PageIndicatorOptions, ) -> Option<usize>
Material/Android pager indicator dots centered within bounds.
When options.interactive is true, tapping cycles to the next page and returns Some(next_page).
Source§impl Frame<'_>
impl Frame<'_>
pub fn progress_circular(&mut self, id: u64, label: &str, value: Option<f32>)
Sourcepub fn wavy_circular_progress(
&mut self,
id: u64,
label: &str,
value: Option<f32>,
options: WavyProgressOptions,
)
pub fn wavy_circular_progress( &mut self, id: u64, label: &str, value: Option<f32>, options: WavyProgressOptions, )
Material 3 Expressive wavy circular progress indicator (48dp default container).
Draws a smooth sinusoidal active wave separated by track_gap from the straight inactive arc.
Source§impl Frame<'_>
impl Frame<'_>
pub fn progress_classic(&mut self, id: u64, label: &str, value: Option<f32>)
Sourcepub fn progress_classic_with_secondary(
&mut self,
id: u64,
label: &str,
value: Option<f32>,
secondary: Option<f32>,
)
pub fn progress_classic_with_secondary( &mut self, id: u64, label: &str, value: Option<f32>, secondary: Option<f32>, )
Linear progress with an optional buffered portion behind the primary bar.
Sourcepub fn progress_classic_directional(
&mut self,
id: u64,
label: &str,
value: Option<f32>,
secondary: Option<f32>,
rtl: bool,
)
pub fn progress_classic_directional( &mut self, id: u64, label: &str, value: Option<f32>, secondary: Option<f32>, rtl: bool, )
Linear progress with optional right-to-left mirroring.
pub fn progress_circular_classic( &mut self, id: u64, label: &str, value: Option<f32>, diameter: f32, )
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn progress(&mut self, id: u64, label: &str, value: Option<f32>)
pub fn progress(&mut self, id: u64, label: &str, value: Option<f32>)
The caller owns semantics of the work. None means visible indeterminate progress.
Sourcepub fn wavy_linear_progress(
&mut self,
id: u64,
label: &str,
value: Option<f32>,
options: WavyProgressOptions,
)
pub fn wavy_linear_progress( &mut self, id: u64, label: &str, value: Option<f32>, options: WavyProgressOptions, )
Material 3 Expressive wavy linear progress indicator.
Draws a smooth sinusoidal active wave separated by track_gap from the straight
inactive track and a trailing stop_indicator_size dot.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn pull_refresh_scroll(
&mut self,
id: u64,
bounds: Rect,
offset: &mut f32,
content_height: f32,
state: &mut PullRefreshState,
refreshing: bool,
build: impl FnOnce(&mut Self, f32),
) -> bool
pub fn pull_refresh_scroll( &mut self, id: u64, bounds: Rect, offset: &mut f32, content_height: f32, state: &mut PullRefreshState, refreshing: bool, build: impl FnOnce(&mut Self, f32), ) -> bool
A scroll viewport that transfers unconsumed touch movement at its top
edge to pull-to-refresh. content_height is the total scrollable height.
The closure paints viewport content using the supplied scroll offset.
Sourcepub fn pull_to_refresh(
&mut self,
bounds: Rect,
state: &mut PullRefreshState,
at_top: bool,
refreshing: bool,
) -> bool
pub fn pull_to_refresh( &mut self, bounds: Rect, state: &mut PullRefreshState, at_top: bool, refreshing: bool, ) -> bool
Processes a touch gesture on a surface whose content is at its top edge.
Returns true once when an armed pull is released. Callers set refreshing
after starting work and clear it on completion. Nested scrolling must be
coordinated by the host; pass at_top only when the child cannot scroll up.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn radio(
&mut self,
id: u64,
label: &str,
selected: bool,
enabled: bool,
) -> Response
pub fn radio( &mut self, id: u64, label: &str, selected: bool, enabled: bool, ) -> Response
Radio choice primitive. Group selection/navigation is supplied by radio_group.
Sourcepub fn radio_directional(
&mut self,
id: u64,
label: &str,
selected: bool,
enabled: bool,
rtl: bool,
) -> Response
pub fn radio_directional( &mut self, id: u64, label: &str, selected: bool, enabled: bool, rtl: bool, ) -> Response
Radio choice with layout-direction-aware indicator placement.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn rating(&mut self, id: u64, value: &mut usize, max: usize, enabled: bool)
pub fn rating(&mut self, id: u64, value: &mut usize, max: usize, enabled: bool)
Whole-star rating with caller-owned value, hover preview and keyboard navigation.
Sourcepub fn rating_fractional(
&mut self,
id: u64,
value: &mut f32,
stars: usize,
step: f32,
enabled: bool,
) -> Response
pub fn rating_fractional( &mut self, id: u64, value: &mut f32, stars: usize, step: f32, enabled: bool, ) -> Response
Fractional rating with direct drag and configurable step size.
pub fn rating_fractional_with_indicator( &mut self, id: u64, value: &mut f32, stars: usize, step: f32, enabled: bool, indicator: bool, ) -> Response
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn scaffold_slots(
&self,
bounds: Rect,
options: ScaffoldOptions,
) -> ScaffoldSlots
pub fn scaffold_slots( &self, bounds: Rect, options: ScaffoldOptions, ) -> ScaffoldSlots
Compute adaptive Material 3 scaffold slot rectangles for bounds.
Sourcepub fn scaffold(
&mut self,
bounds: Rect,
options: ScaffoldOptions,
top_bar: impl FnOnce(&mut Self, Rect),
navigation: impl FnMut(&mut Self, Rect, bool),
body: impl FnOnce(&mut Self, Rect),
fab: impl FnOnce(&mut Self, Rect),
) -> ScaffoldSlots
pub fn scaffold( &mut self, bounds: Rect, options: ScaffoldOptions, top_bar: impl FnOnce(&mut Self, Rect), navigation: impl FnMut(&mut Self, Rect, bool), body: impl FnOnce(&mut Self, Rect), fab: impl FnOnce(&mut Self, Rect), ) -> ScaffoldSlots
Adaptive Material 3 Scaffold rendering top bar, responsive navigation rail or bottom bar, main content body, and optional floating action button slot.
Sourcepub fn scaffold_adaptive(
&mut self,
id: u64,
bounds: Rect,
options: ScaffoldAdaptiveOptions,
rail_expanded: bool,
drawer_open: &mut bool,
top_bar: impl FnOnce(&mut Self, Rect),
navigation: impl FnMut(&mut Self, Rect, f32, bool),
body: impl FnOnce(&mut Self, Rect),
fab: impl FnOnce(&mut Self, Rect),
) -> ScaffoldSlots
pub fn scaffold_adaptive( &mut self, id: u64, bounds: Rect, options: ScaffoldAdaptiveOptions, rail_expanded: bool, drawer_open: &mut bool, top_bar: impl FnOnce(&mut Self, Rect), navigation: impl FnMut(&mut Self, Rect, f32, bool), body: impl FnOnce(&mut Self, Rect), fab: impl FnOnce(&mut Self, Rect), ) -> ScaffoldSlots
Adaptive Material 3 Scaffold with animated rail expansion (collapsed_rail_width <-> expanded_rail_width)
on wide viewports and a modal slide-over drawer slot (drawer_open) on compact viewports.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn scroll_indicator(
&mut self,
viewport: Rect,
content_size: f32,
offset: f32,
orientation: ScrollbarOrientation,
rtl: bool,
fade: bool,
state: &mut ScrollbarIndicatorState,
) -> Option<Rect>
pub fn scroll_indicator( &mut self, viewport: Rect, content_size: f32, offset: f32, orientation: ScrollbarOrientation, rtl: bool, fade: bool, state: &mut ScrollbarIndicatorState, ) -> Option<Rect>
Draw the default Compose Material 3 non-interactive scrollbar indicator. Geometry and timing informed by AndroidX Scrollbar.kt (Apache-2.0), revision 1448d64974931a04c9fba96ac630cbd6b96cda36. Returns its painted bounds when visible. Scroll offsets are clamped to the content range.
Sourcepub fn vertical_scrollbar(
&mut self,
id: u64,
track: Rect,
label: &str,
content_height: f32,
viewport_height: f32,
offset: &mut f32,
state: &mut ScrollbarDragState,
) -> (Response, Rect)
pub fn vertical_scrollbar( &mut self, id: u64, track: Rect, label: &str, content_height: f32, viewport_height: f32, offset: &mut f32, state: &mut ScrollbarDragState, ) -> (Response, Rect)
Vertical scrollbar with an anchored thumb drag and page-sized track clicks.
content_height and viewport_height are measured in the same units as offset.
Sourcepub fn scrollbar_thumb_drag(
&mut self,
id: u64,
thumb: Rect,
track: Rect,
max_offset: f32,
offset: &mut f32,
state: &mut ScrollbarDragState,
)
pub fn scrollbar_thumb_drag( &mut self, id: u64, thumb: Rect, track: Rect, max_offset: f32, offset: &mut f32, state: &mut ScrollbarDragState, )
Drag a vertical scrollbar thumb without changing its appearance.
Sourcepub fn vertical_scrollbar_painted(
&mut self,
id: u64,
track: Rect,
offset: &mut f32,
viewport: f32,
content: f32,
state: &mut ScrollbarDragState,
) -> Response
pub fn vertical_scrollbar_painted( &mut self, id: u64, track: Rect, offset: &mut f32, viewport: f32, content: f32, state: &mut ScrollbarDragState, ) -> Response
Self-painting interactive vertical scrollbar (computes drag/keyboard state, cancels scroll inertia on grab, and paints track + rounded thumb).
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn search_bar_overlay(
&mut self,
id: u64,
state: &mut SearchOverlayState,
placeholder: &str,
suggestions: &[&str],
) -> Option<usize>
pub fn search_bar_overlay( &mut self, id: u64, state: &mut SearchOverlayState, placeholder: &str, suggestions: &[&str], ) -> Option<usize>
Material 3 SearchBar -> SearchView container-transform overlay.
Renders a 56dp pill SearchBar when closed, expanding into a 28dp surfaceContainerHigh
SearchView overlay with back button, clear button, divider, and clickable filtered
suggestion history rows when tapped. Returns the clicked suggestion index into suggestions.
Sourcepub fn inline_search_bar(
&mut self,
id: u64,
bounds: Rect,
placeholder: &str,
query: &str,
show_back: bool,
enabled: bool,
) -> (Response, bool, bool)
pub fn inline_search_bar( &mut self, id: u64, bounds: Rect, placeholder: &str, query: &str, show_back: bool, enabled: bool, ) -> (Response, bool, bool)
Inline docked search bar (top app bar search mode or drawer search pill) with optional
leading back button, query/placeholder display, blinking caret when focused, and clear button.
Returns (field_response, back_clicked, clear_clicked).
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn select(
&mut self,
id: u64,
label: &str,
options: &[&str],
selected: &mut usize,
state: &mut SelectState,
filled: bool,
) -> bool
pub fn select( &mut self, id: u64, label: &str, options: &[&str], selected: &mut usize, state: &mut SelectState, filled: bool, ) -> bool
Material Select dropdown combining select_field, closed-trigger typeahead,
arrow/Home/End selection, and an anchored OverlayKind::Menu popup.
Returns true when selected changed.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn shortcut_hint(&mut self, keys: &[&str], description: &str)
pub fn shortcut_hint(&mut self, keys: &[&str], description: &str)
Render a compact keycap shortcut hint row (e.g. keys = &["Ctrl", "K"], description = "Command palette").
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn skeleton(&mut self, bounds: Rect, radius: f32, animated: bool)
pub fn skeleton(&mut self, bounds: Rect, radius: f32, animated: bool)
Paint a noninteractive loading placeholder with optional MUI-style pulse.
Sourcepub fn skeleton_with_options(&mut self, bounds: Rect, options: SkeletonOptions)
pub fn skeleton_with_options(&mut self, bounds: Rect, options: SkeletonOptions)
Paint a loading placeholder supporting static (None), Pulse, and MUI Wave shimmer.
Source§impl Frame<'_>
impl Frame<'_>
pub fn slider( &mut self, id: u64, label: &str, value: &mut f32, range: RangeInclusive<f32>, step: f32, enabled: bool, ) -> Response
pub fn slider_directional( &mut self, id: u64, label: &str, value: &mut f32, range: RangeInclusive<f32>, step: f32, enabled: bool, rtl: bool, ) -> Response
Sourcepub fn slider_directional_with_secondary(
&mut self,
id: u64,
label: &str,
value: &mut f32,
range: RangeInclusive<f32>,
step: f32,
enabled: bool,
rtl: bool,
secondary: Option<f32>,
) -> Response
pub fn slider_directional_with_secondary( &mut self, id: u64, label: &str, value: &mut f32, range: RangeInclusive<f32>, step: f32, enabled: bool, rtl: bool, secondary: Option<f32>, ) -> Response
Directional slider with an optional buffered fraction behind the primary track.
Sourcepub fn range_slider(
&mut self,
ids: [u64; 2],
label: &str,
values: &mut [f32; 2],
range: RangeInclusive<f32>,
step: f32,
enabled: bool,
) -> [Response; 2]
pub fn range_slider( &mut self, ids: [u64; 2], label: &str, values: &mut [f32; 2], range: RangeInclusive<f32>, step: f32, enabled: bool, ) -> [Response; 2]
Two independently focusable endpoints; drag follows input without animation.
Sourcepub fn expressive_slider(
&mut self,
id: u64,
label: &str,
value: &mut f32,
range: RangeInclusive<f32>,
options: SliderExpressiveOptions,
) -> Response
pub fn expressive_slider( &mut self, id: u64, label: &str, value: &mut f32, range: RangeInclusive<f32>, options: SliderExpressiveOptions, ) -> Response
Material 3 Expressive slider: 16dp rounded tracks, 4dp×44dp vertical pill handle with 6dp track gaps, 4dp stop indicator / discrete ticks, and teardrop value bubble.
Sourcepub fn expressive_range_slider(
&mut self,
ids: [u64; 2],
label: &str,
values: &mut [f32; 2],
range: RangeInclusive<f32>,
options: SliderExpressiveOptions,
) -> [Response; 2]
pub fn expressive_range_slider( &mut self, ids: [u64; 2], label: &str, values: &mut [f32; 2], range: RangeInclusive<f32>, options: SliderExpressiveOptions, ) -> [Response; 2]
Material 3 Expressive range slider with two 4dp×44dp vertical pill handles,
6dp track gaps, min_separation clamping, discrete ticks, and teardrop value bubble.
Sourcepub fn pill_slider(
&mut self,
id: u64,
bounds: Rect,
label: &str,
value: &mut f32,
range: RangeInclusive<f32>,
icon: Option<SystemIcon>,
enabled: bool,
) -> Response
pub fn pill_slider( &mut self, id: u64, bounds: Rect, label: &str, value: &mut f32, range: RangeInclusive<f32>, icon: Option<SystemIcon>, enabled: bool, ) -> Response
Thick horizontal Material 3 Expressive pill-fill slider (brightness/media HUD style)
with optional embedded SystemIcon inside the active pill.
Sourcepub fn vertical_pill_slider(
&mut self,
id: u64,
bounds: Rect,
label: &str,
value: &mut f32,
range: RangeInclusive<f32>,
icon: Option<SystemIcon>,
enabled: bool,
) -> Response
pub fn vertical_pill_slider( &mut self, id: u64, bounds: Rect, label: &str, value: &mut f32, range: RangeInclusive<f32>, icon: Option<SystemIcon>, enabled: bool, ) -> Response
Vertical Material 3 Expressive pill-fill slider (volume HUD style) with bottom-anchored
active fill and optional embedded SystemIcon.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn snackbar_host(
&mut self,
host_id: u64,
viewport: Rect,
host: &mut Host,
presentation: &mut Presentation,
)
pub fn snackbar_host( &mut self, host_id: u64, viewport: Rect, host: &mut Host, presentation: &mut Presentation, )
Render a queued snackbar at the bottom of viewport. Returns outcomes
through Host::take_result; host_id must be stable and unique.
A non-focusable status semantic exposes the message to host adapters.
Source§impl Frame<'_>
impl Frame<'_>
Draw a small split button with independent primary and menu actions. The caller owns expanded state and anchors its menu to the trailing response.
Sized split button with independently enabled actions and RTL placement.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn split_pane(
&mut self,
id: u64,
height: f32,
ratio: &mut f32,
options: SplitPaneOptions,
first: impl FnOnce(&mut Self),
second: impl FnOnce(&mut Self),
) -> Response
pub fn split_pane( &mut self, id: u64, height: f32, ratio: &mut f32, options: SplitPaneOptions, first: impl FnOnce(&mut Self), second: impl FnOnce(&mut Self), ) -> Response
Two-pane resizable split container with pointer-draggable and arrow-key-adjustable divider.
ratio is clamped to options.min_ratio..=options.max_ratio.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn stepper(
&mut self,
id: u64,
steps: &[&str],
state: &mut StepperState,
linear: bool,
body_height: f32,
body: impl FnOnce(&mut Self, usize),
) -> bool
pub fn stepper( &mut self, id: u64, steps: &[&str], state: &mut StepperState, linear: bool, body_height: f32, body: impl FnOnce(&mut Self, usize), ) -> bool
Material horizontal stepper with step circles, completed checkmarks, connector lines,
and a scoped body closure for the active step. Returns true when state.active changed.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn switch_indicator(
&mut self,
id: u64,
track: Rect,
checked: bool,
track_colors: [Color; 2],
thumb_colors: [Color; 2],
)
pub fn switch_indicator( &mut self, id: u64, track: Rect, checked: bool, track_colors: [Color; 2], thumb_colors: [Color; 2], )
Paint an animated switch inside a custom control’s track bounds. Colors are ordered unchecked, then checked. The caller owns input.
pub fn switch( &mut self, id: u64, label: &str, value: &mut bool, enabled: bool, ) -> Response
Sourcepub fn switch_trailing(
&mut self,
id: u64,
label: &str,
value: &mut bool,
enabled: bool,
) -> Response
pub fn switch_trailing( &mut self, id: u64, label: &str, value: &mut bool, enabled: bool, ) -> Response
Switch with the control following its label, as in an Android Switch view.
Sourcepub fn switch_trailing_directional(
&mut self,
id: u64,
label: &str,
value: &mut bool,
enabled: bool,
rtl: bool,
) -> Response
pub fn switch_trailing_directional( &mut self, id: u64, label: &str, value: &mut bool, enabled: bool, rtl: bool, ) -> Response
Android-style trailing switch with layout-direction-aware placement.
Sourcepub fn switch_with_icons(
&mut self,
id: u64,
label: &str,
value: &mut bool,
enabled: bool,
icons: SwitchIconMode,
) -> Response
pub fn switch_with_icons( &mut self, id: u64, label: &str, value: &mut bool, enabled: bool, icons: SwitchIconMode, ) -> Response
Switch with optional selected and unselected icons.
Sourcepub fn switch_with_icons_directional(
&mut self,
id: u64,
label: &str,
value: &mut bool,
enabled: bool,
trailing: bool,
rtl: bool,
icons: SwitchIconMode,
) -> Response
pub fn switch_with_icons_directional( &mut self, id: u64, label: &str, value: &mut bool, enabled: bool, trailing: bool, rtl: bool, icons: SwitchIconMode, ) -> Response
Directional switch with optional icons and configurable control placement.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn tabs(
&mut self,
id: u64,
labels: &[&str],
selected: &mut usize,
enabled: bool,
) -> Response
pub fn tabs( &mut self, id: u64, labels: &[&str], selected: &mut usize, enabled: bool, ) -> Response
A horizontal single-selection group. Tab enters the group; arrows move selection.
Sourcepub fn tabs_with_options(
&mut self,
id: u64,
labels: &[&str],
selected: &mut usize,
options: TabOptions,
) -> Response
pub fn tabs_with_options( &mut self, id: u64, labels: &[&str], selected: &mut usize, options: TabOptions, ) -> Response
Material 3 navigation tabs supporting Primary (3dp top-rounded label-width indicator), Secondary (2dp full-tab-width indicator), and horizontal scrollable overflow.
Sourcepub fn tabs_with_icons(
&mut self,
id: u64,
items: &[TabItem<'_>],
selected: &mut usize,
enabled: bool,
) -> bool
pub fn tabs_with_icons( &mut self, id: u64, items: &[TabItem<'_>], selected: &mut usize, enabled: bool, ) -> bool
Primary Material 3 tabs with stacked top icon + label, Role::TabList container semantics,
arrow/Home/End keyboard navigation, and animated 3dp bottom indicator.
Sourcepub fn tabs_with_icons_options(
&mut self,
id: u64,
items: &[TabItem<'_>],
selected: &mut usize,
enabled: bool,
options: TabOptions,
) -> bool
pub fn tabs_with_icons_options( &mut self, id: u64, items: &[TabItem<'_>], selected: &mut usize, enabled: bool, options: TabOptions, ) -> bool
Material 3 icon + label tabs with configurable TabOptions (primary/secondary indicator, RTL).
Sourcepub fn tabs_with_icons_at(
&mut self,
id: u64,
bar: Rect,
items: &[TabItem<'_>],
selected: &mut usize,
enabled: bool,
options: TabOptions,
) -> bool
pub fn tabs_with_icons_at( &mut self, id: u64, bar: Rect, items: &[TabItem<'_>], selected: &mut usize, enabled: bool, options: TabOptions, ) -> bool
Positioned Material 3 icon + label tabs inside caller-supplied bounds, with Role::TabList
semantics, roving arrow/Home/End navigation, TabOptions styling, and animated indicator.
Source§impl Frame<'_>
impl Frame<'_>
pub fn select_field( &mut self, id: u64, label: &str, value: &str, filled: bool, ) -> Response
Sourcepub fn date_range_field(
&mut self,
id: u64,
label: &str,
value: &str,
open: bool,
) -> (Response, Response)
pub fn date_range_field( &mut self, id: u64, label: &str, value: &str, open: bool, ) -> (Response, Response)
Expose the text portion of a calendar field to an editing backend.
pub fn popup_field( &mut self, id: u64, label: &str, value: &str, filled: bool, icon: FieldAffordance, ) -> Response
Sourcepub fn edit_boundary(
&mut self,
id: u64,
label: &str,
height: f32,
invalid: bool,
) -> Response
pub fn edit_boundary( &mut self, id: u64, label: &str, height: f32, invalid: bool, ) -> Response
Draws an editable-field boundary. Text editing/IME belongs to the host adapter.
Sourcepub fn text_field(
&mut self,
id: u64,
label: &str,
height: f32,
has_value: bool,
invalid: bool,
filled: bool,
) -> Response
pub fn text_field( &mut self, id: u64, label: &str, height: f32, has_value: bool, invalid: bool, filled: bool, ) -> Response
Labeled Material field geometry. Editing/IME remains a backend adapter responsibility.
Sourcepub fn text_field_required(
&mut self,
id: u64,
label: &str,
height: f32,
has_value: bool,
invalid: bool,
filled: bool,
required: bool,
) -> Response
pub fn text_field_required( &mut self, id: u64, label: &str, height: f32, has_value: bool, invalid: bool, filled: bool, required: bool, ) -> Response
Labeled field with an optional required marker and semantic required state.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn action_tile(
&mut self,
id: u64,
bounds: Rect,
icon: SystemIcon,
title: &str,
subtitle: &str,
options: ActionTileOptions,
) -> Response
pub fn action_tile( &mut self, id: u64, bounds: Rect, icon: SystemIcon, title: &str, subtitle: &str, options: ActionTileOptions, ) -> Response
Two-line Material 3 pill toggle/action tile (Quick Settings style) at explicit bounds
with leading SystemIcon, title, collapsible subtitle, and optional trailing chevron.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn time_picker(
&mut self,
id: u64,
label: &str,
state: &mut TimePickerState,
filled: bool,
) -> bool
pub fn time_picker( &mut self, id: u64, label: &str, state: &mut TimePickerState, filled: bool, ) -> bool
Time picker trigger field + scrollable popover slot list (12-hour dropdown default).
Returns true when the selected time slot changed.
Sourcepub fn time_picker_with_options(
&mut self,
id: u64,
label: &str,
state: &mut TimePickerState,
filled: bool,
options: TimePickerOptions,
) -> bool
pub fn time_picker_with_options( &mut self, id: u64, label: &str, state: &mut TimePickerState, filled: bool, options: TimePickerOptions, ) -> bool
Time picker supporting Dropdown slot list or interactive Material Dial face in 12h or 24h format.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn toast(
&mut self,
state: &mut ToastState,
container: Rect,
bottom_margin: f32,
)
pub fn toast( &mut self, state: &mut ToastState, container: Rect, bottom_margin: f32, )
Paint an auto-sized centered floating Toast pill near the bottom of container
and schedule wake_at for dismissal. Clears state.message once expired.
Sourcepub fn toast_with_options(
&mut self,
state: &mut ToastState,
container: Rect,
bottom_margin: f32,
options: ToastOptions,
)
pub fn toast_with_options( &mut self, state: &mut ToastState, container: Rect, bottom_margin: f32, options: ToastOptions, )
Paint a floating Toast pill with optional custom background/foreground tint and radius.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn toolbar(
&mut self,
id: u64,
bounds: Rect,
kind: ToolbarKind,
vibrant: bool,
actions: &[ToolbarAction<'_>],
) -> Option<usize>
pub fn toolbar( &mut self, id: u64, bounds: Rect, kind: ToolbarKind, vibrant: bool, actions: &[ToolbarAction<'_>], ) -> Option<usize>
Draw a docked or floating action toolbar. The caller owns placement, actions, and any overflow policy; returns the activated action index.
Sourcepub fn toolbar_roving(
&mut self,
id: u64,
bounds: Rect,
kind: ToolbarKind,
vibrant: bool,
actions: &[ToolbarAction<'_>],
state: &mut ToolbarState,
rtl: bool,
) -> Option<usize>
pub fn toolbar_roving( &mut self, id: u64, bounds: Rect, kind: ToolbarKind, vibrant: bool, actions: &[ToolbarAction<'_>], state: &mut ToolbarState, rtl: bool, ) -> Option<usize>
Toolbar with one tab stop and arrow-key navigation.
Sourcepub fn docked_toolbar_scroll_offset(
&mut self,
state: &mut DockedToolbarScrollState,
consumed: f32,
height: f32,
touch_exploration: bool,
) -> f32
pub fn docked_toolbar_scroll_offset( &mut self, state: &mut DockedToolbarScrollState, consumed: f32, height: f32, touch_exploration: bool, ) -> f32
Sample bottom-edge hide-on-scroll. Positive consumed deltas hide; negative show. Touch exploration forces visibility; the caller must reserve content padding.
Sourcepub fn floating_toolbar_scroll_offset(
&mut self,
state: &mut DockedToolbarScrollState,
consumed: f32,
hide_distance: f32,
) -> f32
pub fn floating_toolbar_scroll_offset( &mut self, state: &mut DockedToolbarScrollState, consumed: f32, hide_distance: f32, ) -> f32
Bottom-anchored floating toolbar hide-on-scroll offset. hide_distance
includes the toolbar height and its gap to the viewport’s bottom edge.
Sourcepub fn docked_toolbar_with_insets(
&mut self,
id: u64,
bounds: Rect,
insets: DockedToolbarInsets,
vibrant: bool,
actions: &[ToolbarAction<'_>],
icons: &[AppBarIcon],
primary: Option<usize>,
state: &mut ToolbarState,
rtl: bool,
) -> Option<usize>
pub fn docked_toolbar_with_insets( &mut self, id: u64, bounds: Rect, insets: DockedToolbarInsets, vibrant: bool, actions: &[ToolbarAction<'_>], icons: &[AppBarIcon], primary: Option<usize>, state: &mut ToolbarState, rtl: bool, ) -> Option<usize>
Docked toolbar whose background also fills host-supplied system insets.
Sourcepub fn docked_toolbar_with_overflow(
&mut self,
id: u64,
bounds: Rect,
vibrant: bool,
actions: &[ToolbarAction<'_>],
icons: &[AppBarIcon],
primary: Option<usize>,
state: &mut ToolbarState,
rtl: bool,
) -> Option<usize>
pub fn docked_toolbar_with_overflow( &mut self, id: u64, bounds: Rect, vibrant: bool, actions: &[ToolbarAction<'_>], icons: &[AppBarIcon], primary: Option<usize>, state: &mut ToolbarState, rtl: bool, ) -> Option<usize>
Android-style 64 dp docked toolbar with icon actions and optional primary action.
Sourcepub fn floating_toolbar_with_fab(
&mut self,
id: u64,
bounds: Rect,
kind: ToolbarKind,
vibrant: bool,
actions: &[ToolbarAction<'_>],
state: &mut ToolbarState,
rtl: bool,
fab: ToolbarAction<'_>,
icon: AppBarIcon,
position: ToolbarFabPosition,
) -> Option<ToolbarFabSelection>
pub fn floating_toolbar_with_fab( &mut self, id: u64, bounds: Rect, kind: ToolbarKind, vibrant: bool, actions: &[ToolbarAction<'_>], state: &mut ToolbarState, rtl: bool, fab: ToolbarAction<'_>, icon: AppBarIcon, position: ToolbarFabPosition, ) -> Option<ToolbarFabSelection>
Floating toolbar and 56 dp FAB separated by the Material 8 dp gap.
The FAB uses id + 132; toolbar and overflow reserve id..=id + 131.
Bounds too small for a FAB, gap and one toolbar slot return no action.
Sourcepub fn floating_toolbar_with_fab_expanded(
&mut self,
id: u64,
bounds: Rect,
kind: ToolbarKind,
vibrant: bool,
actions: &[ToolbarAction<'_>],
state: &mut ToolbarState,
rtl: bool,
fab: ToolbarAction<'_>,
icon: AppBarIcon,
position: ToolbarFabPosition,
expanded: bool,
) -> Option<ToolbarFabSelection>
pub fn floating_toolbar_with_fab_expanded( &mut self, id: u64, bounds: Rect, kind: ToolbarKind, vibrant: bool, actions: &[ToolbarAction<'_>], state: &mut ToolbarState, rtl: bool, fab: ToolbarAction<'_>, icon: AppBarIcon, position: ToolbarFabPosition, expanded: bool, ) -> Option<ToolbarFabSelection>
Expandable floating toolbar paired with a 56–80 dp FAB. The caller owns the expanded state and supplies stable bounds with at least 80 dp cross size. Toolbar actions stop accepting input immediately when collapse is requested.
Sourcepub fn toolbar_with_overflow(
&mut self,
id: u64,
bounds: Rect,
kind: ToolbarKind,
vibrant: bool,
actions: &[ToolbarAction<'_>],
state: &mut ToolbarState,
rtl: bool,
) -> Option<usize>
pub fn toolbar_with_overflow( &mut self, id: u64, bounds: Rect, kind: ToolbarKind, vibrant: bool, actions: &[ToolbarAction<'_>], state: &mut ToolbarState, rtl: bool, ) -> Option<usize>
Toolbar with a menu for actions that do not fit. Supports up to 64 actions.
IDs id..=id+131 are reserved; returns the original action index.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn tooltip(&mut self, id: u64, response: Response, text: &str)
pub fn tooltip(&mut self, id: u64, response: Response, text: &str)
Hover delay uses an idle deadline, not a spinning frame loop. Call after the owner.
Sourcepub fn rich_tooltip(
&mut self,
id: u64,
anchor: Response,
subhead: &str,
body: &str,
action_label: Option<&str>,
) -> bool
pub fn rich_tooltip( &mut self, id: u64, anchor: Response, subhead: &str, body: &str, action_label: Option<&str>, ) -> bool
Material 3 Rich Tooltip: 12dp radius, level-2 elevation, surface_low container,
bold 14sp subhead, 14sp body text, and an optional interactive primary text action
button returning true when clicked.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn page(
&mut self,
id: u64,
active: bool,
bounds: Rect,
direction: PageDirection,
build: impl FnOnce(&mut Self, Rect),
) -> f32
pub fn page( &mut self, id: u64, active: bool, bounds: Rect, direction: PageDirection, build: impl FnOnce(&mut Self, Rect), ) -> f32
A caller-selected page with Beer CSS’s 400ms fade and directional entry.
Sourcepub fn grow(
&mut self,
id: u64,
open: bool,
bounds: Rect,
build: impl FnOnce(&mut Self),
) -> (f32, f32)
pub fn grow( &mut self, id: u64, open: bool, bounds: Rect, build: impl FnOnce(&mut Self), ) -> (f32, f32)
Grow a bounded subtree using MUI’s height-based timing and scale profile.
Sourcepub fn slide_up(
&mut self,
id: u64,
open: bool,
bounds: Rect,
build: impl FnOnce(&mut Self, Rect),
) -> f32
pub fn slide_up( &mut self, id: u64, open: bool, bounds: Rect, build: impl FnOnce(&mut Self, Rect), ) -> f32
Slide a bounded subtree up from the lower viewport edge.
Sourcepub fn slide(
&mut self,
id: u64,
open: bool,
bounds: Rect,
direction: SlideDirection,
build: impl FnOnce(&mut Self, Rect),
) -> f32
pub fn slide( &mut self, id: u64, open: bool, bounds: Rect, direction: SlideDirection, build: impl FnOnce(&mut Self, Rect), ) -> f32
Slide a bounded subtree in from any edge (Up, Down, Left, Right).
Sourcepub fn collapse(
&mut self,
id: u64,
open: bool,
height: f32,
build: impl FnOnce(&mut Self),
) -> f32
pub fn collapse( &mut self, id: u64, open: bool, height: f32, build: impl FnOnce(&mut Self), ) -> f32
Collapse a subtree vertically using MUI’s automatic height duration.
Sourcepub fn zoom(
&mut self,
id: u64,
open: bool,
bounds: Rect,
build: impl FnOnce(&mut Self),
) -> f32
pub fn zoom( &mut self, id: u64, open: bool, bounds: Rect, build: impl FnOnce(&mut Self), ) -> f32
Scale a bounded subtree using MUI’s default Zoom timings.
Sourcepub fn fade(
&mut self,
id: u64,
open: bool,
bounds: Rect,
build: impl FnOnce(&mut Self),
) -> f32
pub fn fade( &mut self, id: u64, open: bool, bounds: Rect, build: impl FnOnce(&mut Self), ) -> f32
Fade a bounded subtree using MUI’s default enter and exit timings.
Sourcepub fn with_scale(
&mut self,
origin: [f32; 2],
scale: f32,
build: impl FnOnce(&mut Self),
)
pub fn with_scale( &mut self, origin: [f32; 2], scale: f32, build: impl FnOnce(&mut Self), )
Scale a subtree’s geometry, text, clipping, semantics and pointer coordinates together.
pub fn with_opacity(&mut self, alpha: f32, build: impl FnOnce(&mut Self))
Sourcepub fn animated_wavy_shape(
&mut self,
bounds: Rect,
index: usize,
color: Color,
state: &mut ShapeRotationState,
) -> bool
pub fn animated_wavy_shape( &mut self, bounds: Rect, index: usize, color: Color, state: &mut ShapeRotationState, ) -> bool
Animate Beer CSS’s two wavy shapes. Other shapes remain static.
Sourcepub fn rotating_shape(
&mut self,
bounds: Rect,
index: usize,
color: Color,
seconds: f64,
state: &mut ShapeRotationState,
) -> bool
pub fn rotating_shape( &mut self, bounds: Rect, index: usize, color: Color, seconds: f64, state: &mut ShapeRotationState, ) -> bool
Paint a continuously rotating shape; duration is seconds per revolution.
Sourcepub fn reveal(
&mut self,
id: u64,
open: bool,
height: f32,
build: impl FnOnce(&mut Self),
)
pub fn reveal( &mut self, id: u64, open: bool, height: f32, build: impl FnOnce(&mut Self), )
Reversible measured reveal: full child layout, clipped presentation and no exit input.
pub fn transition( &mut self, id: u64, property: u8, target: f32, initial: f32, duration: f64, easing: Easing, ) -> f32
Sourcepub fn transition_css(
&mut self,
id: u64,
property: u8,
target: f32,
initial: f32,
duration: f64,
easing: Easing,
) -> f32
pub fn transition_css( &mut self, id: u64, property: u8, target: f32, initial: f32, duration: f64, easing: Easing, ) -> f32
CSS transition sampling, including shortened reversals.
Sourcepub fn route_transition(
&mut self,
bounds: Rect,
state: RouteTransitionState,
outgoing: impl FnOnce(&mut Self),
incoming: impl FnOnce(&mut Self),
) -> bool
pub fn route_transition( &mut self, bounds: Rect, state: RouteTransitionState, outgoing: impl FnOnce(&mut Self), incoming: impl FnOnce(&mut Self), ) -> bool
Dual-screen Android / Material route transition (Push/Pop Shared-Axis X parallax with
scrim & page-edge shadow, or ModalUp/ModalDown vertical slide+fade).
Returns true while the transition is still animating.
Sourcepub fn edge_back_indicator(
&mut self,
bounds: Rect,
from_right_edge: bool,
y: f32,
progress: f32,
committed: bool,
)
pub fn edge_back_indicator( &mut self, bounds: Rect, from_right_edge: bool, y: f32, progress: f32, committed: bool, )
Predictive edge-back folding chevron indicator (| -> < / >) floating at edge y.
Sourcepub fn circular_reveal(
&mut self,
bounds: Rect,
origin: [f32; 2],
progress: f32,
backdrop: Color,
build: impl FnOnce(&mut Self, f32),
)
pub fn circular_reveal( &mut self, bounds: Rect, origin: [f32; 2], progress: f32, backdrop: Color, build: impl FnOnce(&mut Self, f32), )
Clip the backdrop and incoming content to a circle centered at origin.
Progress is caller-owned and may run in either direction. Content is
noninteractive until fully revealed.
Sourcepub fn container_transform(
&mut self,
from: Rect,
to: Rect,
from_radius: f32,
to_radius: f32,
from_bg: Color,
to_bg: Color,
progress: f32,
from_content: impl FnOnce(&mut Self, Rect),
to_content: impl FnOnce(&mut Self, Rect),
)
pub fn container_transform( &mut self, from: Rect, to: Rect, from_radius: f32, to_radius: f32, from_bg: Color, to_bg: Color, progress: f32, from_content: impl FnOnce(&mut Self, Rect), to_content: impl FnOnce(&mut Self, Rect), )
Generic Material container-transform morph interpolating rectangle bounds, corner radius, surface fill color, and cross-fading outgoing & incoming content.
Source§impl Frame<'_>
impl Frame<'_>
Sourcepub fn floating_window(
&mut self,
id: u64,
title: &str,
state: &mut WindowFrameState,
options: WindowFrameOptions,
body: impl FnOnce(&mut Self, Rect),
) -> WindowFrameAction
pub fn floating_window( &mut self, id: u64, title: &str, state: &mut WindowFrameState, options: WindowFrameOptions, body: impl FnOnce(&mut Self, Rect), ) -> WindowFrameAction
Paint a floating elevated window with draggable caption bar, maximize/close actions,
bottom-right resize grip, and clipped live body content.
Source§impl Frame<'_>
impl Frame<'_>
pub fn elevation(&mut self, b: Rect, radius: f32, level: u8)
Sourcepub fn panel(&mut self, height: f32, build: impl FnOnce(&mut Self))
pub fn panel(&mut self, height: f32, build: impl FnOnce(&mut Self))
Fixed-size grouping surface; children are clipped and use the same stable ID namespace.
pub fn within(&mut self, bounds: Rect, build: impl FnOnce(&mut Self))
Sourcepub fn within_unclipped(&mut self, bounds: Rect, build: impl FnOnce(&mut Self))
pub fn within_unclipped(&mut self, bounds: Rect, build: impl FnOnce(&mut Self))
Lay out children within bounds while preserving the existing paint clip. This allows effects such as shadows to extend beyond the layout bounds.
Source§impl Frame<'_>
impl Frame<'_>
pub fn theme(&self) -> Theme
pub fn input(&self) -> Input
Sourcepub fn take_text_input_request(&mut self) -> Option<(u64, Rect)>
pub fn take_text_input_request(&mut self) -> Option<(u64, Rect)>
Consume a text-field tap so the host can show its input method. Call after building the interactive view.
Sourcepub fn text_input_bounds(&self, id: u64) -> Option<Rect>
pub fn text_input_bounds(&self, id: u64) -> Option<Rect>
Bounds of an enabled text field registered in this frame.
pub fn clear(&mut self, color: Color)
pub fn available(&self) -> Rect
pub fn with_enabled(&mut self, enabled: bool, build: impl FnOnce(&mut Self))
Sourcepub fn record_paint(
&mut self,
build: impl FnOnce(&mut Self),
) -> Vec<DrawCommand>
pub fn record_paint( &mut self, build: impl FnOnce(&mut Self), ) -> Vec<DrawCommand>
Copy the paint commands emitted by a view so they can be drawn again without its input targets.
Sourcepub fn replay_paint(&mut self, commands: &[DrawCommand])
pub fn replay_paint(&mut self, commands: &[DrawCommand])
Replay a balanced sequence returned by record_paint in the current transform and clip.
pub fn styled_text( &mut self, bounds: Rect, text: &str, color: Color, style: TextStyle, )
Sourcepub fn set_system_font(&mut self, font: SystemFont)
pub fn set_system_font(&mut self, font: SystemFont)
Set the system font for layout and painting in the current frame. Call this before building any text widgets.
pub fn text_width(&self, text: &str, style: TextStyle) -> f32
pub fn shadow( &mut self, bounds: Rect, radius: f32, offset: [f32; 2], blur: f32, spread: f32, color: Color, )
pub fn push_transform( &mut self, origin: [f32; 2], translate: [f32; 2], scale: [f32; 2], rotation_rad: f32, )
pub fn pop_transform(&mut self)
Sourcepub fn push_projective(&mut self, matrix: [[f32; 3]; 3]) -> bool
pub fn push_projective(&mut self, matrix: [[f32; 3]; 3]) -> bool
Push a homography. Call pop_transform after drawing.
pub fn push_layer(&mut self, bounds: Rect, alpha: f32)
Sourcepub fn within_rounded_layer(
&mut self,
bounds: Rect,
radius: f32,
build: impl FnOnce(&mut Self),
)
pub fn within_rounded_layer( &mut self, bounds: Rect, radius: f32, build: impl FnOnce(&mut Self), )
Clip a group of drawing commands to an axis-aligned rounded rectangle. Use screen-space bounds, then put any content transforms inside the layer.
pub fn pop_layer(&mut self)
Sourcepub fn focus_ring(&mut self, response: Response)
pub fn focus_ring(&mut self, response: Response)
Paint the shared keyboard focus indicator for a custom semantic target.