Expand description
frust-material: the Material 3 (+Expressive) design-system catalog
plugin.
A design-system plugin: it sits beside the frust facade in an app’s
own dependency list (never inside it — see docs/ARCHITECTURE.md’s
Facade/plugin boundary), built entirely on frust’s public
default-features = false surface (frust::authoring plus the
whole-crate kurbo/peniko valves) so it proves the same external
design-system contract examples/design-system-sample does.
§Flat symbol surface
Every widget/spec type below is flat re-exported at the crate root — an
app never names a submodule directly, e.g. frust_material::AppBar,
frust_material::card, frust_material::show_dialog. This mirrors how
the in-tree catalog it was extracted from is consumed through the frust
facade (frust::AppBar, frust::card, …).
RoundedPolygon is the flat re-export of shapes::RoundedPolygon, the
feature-point geometry engine ported from material_new_shapes — every
shape-morphing consumer in this crate, including
loading_indicator’s shape sequence, builds on this one engine;
the older, since-removed radial-model polygon module has no remaining
callers.
icons is the one deliberate exception: its 88 generated
frust::IconSource constants stay namespaced (frust_material::icons::CHECK),
not flat re-exported at the crate root — see that module’s own doc for
provenance and the regen command.
selection’s pure index-set controller functions (is_selected,
toggle, select_all, …) stay namespaced the same way
(frust_material::selection::toggle) — their names are too generic to
flatten safely without shadowing. The module’s own widget types
(selection_host, selection_app_bar) are flat re-exported as
usual.
date_picker’s pure grid-geometry functions (year_grid_height,
calendar_day_view_height, year_span, …) stay namespaced for the same
reason (frust_material::date_picker::grid::year_span); its widgets, value
types (MaterialDate, DateRange, DatePickerState) and metric
constants are flat re-exported as usual.
§install(): this design system’s one-line installer
install seeds frust::set_default_theme with this crate’s
baseline token bundle and registers its bundled Roboto Flex and Roboto
Mono typefaces so Material typography resolves out of the box. Call it from
frust::app!’s setup = { .. } block, before the shell
is constructed — the one point a shell reads the default-theme slot:
use frust::{Align, Alignment, Component, CrossAxisAlignment, View, column, icon, scaffold, text};
use frust_material::{AppBarContainer, app_bar, fab, icons};
#[derive(Default)]
pub struct CounterApp;
impl Component for CounterApp {
type State = u32;
fn init(&self) -> u32 {
0
}
fn build(&self, count: &mut u32) -> impl View<u32> {
scaffold(Align(
Alignment::CENTER,
column()
.child(text("You have pushed the button this many times:"))
.child(text(count.to_string()).size(48.0))
.cross_axis(CrossAxisAlignment::Center),
))
.app_bar(
app_bar::<u32>("Counter")
.container(AppBarContainer::InversePrimary)
.elevation(2),
)
.fab(Self::increment_fab())
}
}
impl CounterApp {
fn increment_fab() -> impl View<u32> {
fab(icon(icons::ADD), |count: &mut u32| *count += 1).label("Increment")
}
}
frust::app!(
CounterApp,
setup = {
frust_material::install();
}
);A call after shell construction takes effect only on a later
clear_app_theme-driven reseed, which may never happen — so a late call
silently does nothing visible (the same timing contract
frust::glyph_theme::install and frust_shadcn::install document).
Re-exports§
pub use appbar::AppBar;pub use appbar::AppBarCollapse;pub use appbar::AppBarContainer;pub use appbar::AppBarDensity;pub use appbar::AppBarMetrics;pub use appbar::AppBarShapeFamily;pub use appbar::AppBarVariant;pub use appbar::AppBarView;pub use appbar::AppBarWidget;pub use appbar::BottomAppBar;pub use appbar::BottomAppBarView;pub use appbar::BottomAppBarWidget;pub use appbar::SearchAppBar;pub use appbar::SliverAppBar;pub use appbar::SliverAppBarView;pub use appbar::SliverAppBarWidget;pub use appbar::app_bar;pub use appbar::bottom_app_bar;pub use appbar::search_app_bar;pub use appbar::sliver_app_bar;pub use badge::BadgeAlignment;pub use badge::BadgeView;pub use badge::BadgeWidget;pub use badge::badge;pub use button::Button;pub use button::ButtonDecoration;pub use button::ButtonShape;pub use button::ButtonSize;pub use button::ButtonSurface;pub use button::ButtonVariant;pub use button::ButtonView;pub use button::ButtonWidget;pub use button::ContentMetrics;pub use button::DecorationOutcome;pub use button::GradientAlignment;pub use button::GradientButtonDecoration;pub use button::GradientProperty;pub use button::GradientSpec;pub use button::GradientStates;pub use button::IconAlignment;pub use button::LinearGradientSpec;pub use button::OverflowObserver;pub use button::OverflowStrategy;pub use button::RadialGradientSpec;pub use button::SweepGradientSpec;pub use button::constant_gradient;pub use button::implied_stops;pub use button_group::ButtonGroup;pub use button_group::ButtonGroupAction;pub use button_group::ButtonGroupDensity;pub use button_group::ButtonGroupDirection;pub use button_group::ButtonGroupOverflow;pub use button_group::ButtonGroupType;pub use button_group::ButtonGroupView;pub use button_group::ButtonGroupWidget;pub use card::CardVariant;pub use card::CardView;pub use card::CardWidget;pub use card::card;pub use card::elevated_card;pub use card::filled_card;pub use card::outlined_card;pub use card_list::CARD_LIST_GAP;pub use card_list::CARD_LIST_INNER_RADIUS;pub use card_list::CARD_LIST_ITEM_PADDING;pub use card_list::CARD_LIST_OUTER_RADIUS;pub use card_list::CardListView;pub use card_list::CardListWidget;pub use card_list::CardPosition;pub use card_list::card_list;pub use card_list::card_list_items;pub use card_list::card_position;pub use card_list::card_radii;pub use carousel::CAROUSEL_ITEM_PADDING;pub use carousel::CAROUSEL_ITEM_RADIUS;pub use carousel::CarouselAxis;pub use carousel::CarouselChange;pub use carousel::CarouselLayout;pub use carousel::CarouselView;pub use carousel::CarouselWidget;pub use carousel::HeroAlignment;pub use carousel::UNCONTAINED_ITEM_EXTENT;pub use carousel::UNCONTAINED_SHRINK_EXTENT;pub use carousel::carousel;pub use carousel::contained_carousel;pub use carousel::hero_carousel;pub use carousel::uncontained_carousel;pub use checkbox::Checkbox;pub use checkbox::CheckboxView;pub use checkbox::CheckboxWidget;pub use checkbox::checkbox;pub use checkbox::tristate_checkbox;pub use chips::AssistChip;pub use chips::AssistChipView;pub use chips::AssistChipWidget;pub use chips::FilterChip;pub use chips::FilterChipView;pub use chips::FilterChipWidget;pub use chips::InputChip;pub use chips::InputChipView;pub use chips::InputChipWidget;pub use chips::SuggestionChip;pub use chips::SuggestionChipView;pub use chips::SuggestionChipWidget;pub use chips::assist_chip;pub use chips::filter_chip;pub use chips::input_chip;pub use chips::suggestion_chip;pub use date_picker::ACTIONS_MIN_HEIGHT;pub use date_picker::ARROW_ICON_SIZE;pub use date_picker::ARROW_PADDING;pub use date_picker::CALENDAR_PADDING;pub use date_picker::CALENDAR_WIDTH;pub use date_picker::CalendarDatePicker;pub use date_picker::CalendarDatePickerWidget;pub use date_picker::DAY_GRID_TOP_PADDING;pub use date_picker::DAY_ROW_HEIGHT;pub use date_picker::DAY_SIZE;pub use date_picker::DAYS_PER_WEEK;pub use date_picker::DIALOG_PORTRAIT_CALENDAR_WIDTH;pub use date_picker::DIALOG_PORTRAIT_INPUT_WIDTH;pub use date_picker::DISABLED_DAY_OPACITY;pub use date_picker::DateInputError;pub use date_picker::DateInputField;pub use date_picker::DateInputFieldWidget;pub use date_picker::DatePickerDialog;pub use date_picker::DatePickerEntryMode;pub use date_picker::DatePickerMode;pub use date_picker::DatePickerState;pub use date_picker::DatePickerStrings;pub use date_picker::DateRange;pub use date_picker::HEADER_PORTRAIT_HEIGHT;pub use date_picker::MAX_DAY_PICKER_HEIGHT;pub use date_picker::MAX_DAY_PICKER_ROW_COUNT;pub use date_picker::MAX_YEAR;pub use date_picker::MIN_YEAR;pub use date_picker::MONTH_NAV_BUTTONS_WIDTH;pub use date_picker::MONTH_SCROLL_DURATION;pub use date_picker::MaterialDate;pub use date_picker::MonthGrid;pub use date_picker::OnDatePickerChange;pub use date_picker::RANGE_HIGHLIGHT_ALPHA;pub use date_picker::SUB_HEADER_HEIGHT;pub use date_picker::SUB_HEADER_START_INSET;pub use date_picker::WEEKDAY_ROW_HEIGHT;pub use date_picker::YEAR_COLUMN_COUNT;pub use date_picker::YEAR_GRID_PADDING;pub use date_picker::YEAR_ROW_HEIGHT;pub use date_picker::YEAR_ROW_SPACING;pub use date_picker::calendar_date_picker;pub use date_picker::date_input_field;pub use date_picker::date_picker_dialog;pub use date_picker::days_in_month;pub use date_picker::is_leap_year;pub use date_picker::parse_bounded;pub use date_picker::show_date_picker;pub use dialog::DialogView;pub use dialog::FullScreenDialogView;pub use dialog::SelectionDialogView;pub use dialog::dialog;pub use dialog::full_screen_dialog;pub use dialog::selection_dialog;pub use dialog::show_dialog;pub use dialog::show_full_screen_dialog;pub use dialog::show_selection_dialog;pub use dismissible::DISMISS_ACTION_GAP;pub use dismissible::DISMISS_BACKGROUND_RADIUS;pub use dismissible::DISMISS_COLLAPSE_HANDOFF;pub use dismissible::DISMISS_FLING_VELOCITY;pub use dismissible::DISMISS_FLY_OVERSHOOT;pub use dismissible::DISMISS_ICON_SIZE;pub use dismissible::DISMISS_THRESHOLD;pub use dismissible::DismissBackground;pub use dismissible::DismissDirection;pub use dismissible::DismissibleView;pub use dismissible::DismissibleWidget;pub use dismissible::dismiss_background;pub use dismissible::dismissible;pub use dismissible::speed_multiplier;pub use divider::DividerView;pub use divider::DividerWidget;pub use divider::divider;pub use dropdown::DROPDOWN_CHIP_H_PADDING;pub use dropdown::DROPDOWN_CHIP_ICON_SIZE;pub use dropdown::DROPDOWN_CHIP_LABEL_GAP;pub use dropdown::DROPDOWN_CHIP_RADIUS;pub use dropdown::DROPDOWN_CHIP_RUN_SPACING;pub use dropdown::DROPDOWN_CHIP_SPACING;pub use dropdown::DROPDOWN_CHIP_V_PADDING;pub use dropdown::DROPDOWN_CONTENT_PADDING;pub use dropdown::DROPDOWN_EMPTY_TEXT;pub use dropdown::DROPDOWN_FIELD_H_PADDING;pub use dropdown::DROPDOWN_FIELD_HOVER_ALPHA;pub use dropdown::DROPDOWN_FIELD_LOADING_SIZE;pub use dropdown::DROPDOWN_FIELD_LOADING_STROKE;pub use dropdown::DROPDOWN_FIELD_PRESSED_ALPHA;pub use dropdown::DROPDOWN_FIELD_V_PADDING;pub use dropdown::DROPDOWN_HINT;pub use dropdown::DROPDOWN_ICON_GAP;pub use dropdown::DROPDOWN_ICON_SIZE;pub use dropdown::DROPDOWN_ITEM_GAP;pub use dropdown::DROPDOWN_ITEM_H_PADDING;pub use dropdown::DROPDOWN_ITEM_HOVER_RADIUS;pub use dropdown::DROPDOWN_ITEM_INNER_RADIUS;pub use dropdown::DROPDOWN_ITEM_OUTER_RADIUS;pub use dropdown::DROPDOWN_ITEM_PRESSED_RADIUS;pub use dropdown::DROPDOWN_ITEM_V_PADDING;pub use dropdown::DROPDOWN_LOADING_PADDING;pub use dropdown::DROPDOWN_MESSAGE_PADDING;pub use dropdown::DROPDOWN_PANEL_GAP;pub use dropdown::DROPDOWN_PANEL_MAX_HEIGHT;pub use dropdown::DROPDOWN_SEARCH_HINT;pub use dropdown::DropdownColors;pub use dropdown::DropdownFieldView;pub use dropdown::DropdownFieldWidget;pub use dropdown::DropdownItem;pub use dropdown::DropdownPanelView;pub use dropdown::DropdownPanelWidget;pub use dropdown::DropdownView;pub use dropdown::dropdown;pub use dropdown::dropdown_field;pub use dropdown::dropdown_filter;pub use dropdown::dropdown_item;pub use dropdown::dropdown_matches;pub use dropdown::dropdown_panel;pub use expandable_list::EXPANDABLE_GAP;pub use expandable_list::EXPANDABLE_HOVER_RADIUS;pub use expandable_list::EXPANDABLE_ICON_ROTATION;pub use expandable_list::EXPANDABLE_INNER_RADIUS;pub use expandable_list::EXPANDABLE_OUTER_RADIUS;pub use expandable_list::EXPANDABLE_PRESSED_RADIUS;pub use expandable_list::ExpandMode;pub use expandable_list::ExpandableItem;pub use expandable_list::ExpandableListView;pub use expandable_list::ExpandableListWidget;pub use expandable_list::REVEAL_SPRING;pub use expandable_list::expandable_item;pub use expandable_list::expandable_list;pub use expandable_list::is_expanded;pub use expandable_list::toggle_expanded;pub use fab::FabColor;pub use fab::FabSize;pub use fab::FabView;pub use fab::FabWidget;pub use fab::extended_fab;pub use fab::fab;pub use fab_menu::FabMenu;pub use fab_menu::FabMenuItem;pub use fab_menu::FabMenuView;pub use fab_menu::FabMenuWidget;pub use icon_button::BadgeValue;pub use icon_button::IconButton;pub use icon_button::IconButtonShape;pub use icon_button::IconButtonSize;pub use icon_button::IconButtonVariant;pub use icon_button::IconButtonView;pub use icon_button::IconButtonWidget;pub use icon_button::IconButtonWidth;pub use interaction::HapticSignal;pub use interaction::InteractionState;pub use interaction::MaterialHaptics;pub use list_item::ListItem;pub use list_item::ListItemLines;pub use list_item::ListItemWidget;pub use list_item::ONE_LINE_HEIGHT;pub use list_item::THREE_LINE_HEIGHT;pub use list_item::TWO_LINE_HEIGHT;pub use list_item::list_item;pub use loading_indicator::LoadingIndicator;pub use loading_indicator::LoadingIndicatorVariant;pub use loading_indicator::LoadingIndicatorView;pub use loading_indicator::LoadingIndicatorWidget;pub use loading_indicator::loading_indicator;pub use menu::MenuAction;pub use menu::MenuColorStyle;pub use menu::MenuColors;pub use menu::MenuEntry;pub use menu::MenuGroup;pub use menu::MenuIcon;pub use menu::MenuNode;pub use menu::MenuPanelView;pub use menu::MenuPanelWidget;pub use menu::MenuSelectable;pub use menu::MenuSelection;pub use menu::MenuToggleable;pub use menu::MenuView;pub use navbar::HEIGHT_MEDIUM as NAV_BAR_HEIGHT_MEDIUM;pub use navbar::HEIGHT_SMALL as NAV_BAR_HEIGHT_SMALL;pub use navbar::INDICATOR_H as NAV_BAR_INDICATOR_H;pub use navbar::INDICATOR_W as NAV_BAR_INDICATOR_W;pub use navbar::LEAD_SPRING as NAV_INDICATOR_LEAD_SPRING;pub use navbar::TRAIL_SPRING as NAV_INDICATOR_TRAIL_SPRING;pub use navbar::UNDERLINE_THICKNESS as NAV_BAR_UNDERLINE_THICKNESS;pub use navigation_drawer::DRAWER_WIDTH;pub use navigation_drawer::DrawerContentView;pub use navigation_drawer::DrawerContentWidget;pub use navigation_drawer::DrawerDestination;pub use navigation_drawer::DrawerSection;pub use navigation_drawer::drawer_destination;pub use navigation_drawer::drawer_section;pub use navigation_rail::RAIL_COLLAPSED_WIDTH;pub use navigation_rail::RAIL_EXPAND_CURVE;pub use navigation_rail::RAIL_EXPAND_DURATION;pub use navigation_rail::RAIL_EXPANDED_MAX_WIDTH;pub use navigation_rail::RAIL_EXPANDED_MIN_WIDTH;pub use navigation_rail::RAIL_ITEM_COLLAPSED_HEIGHT;pub use navigation_rail::RAIL_ITEM_EXPANDED_HEIGHT;pub use navigation_rail::RAIL_LEAD_SPRING;pub use navigation_rail::RAIL_TRAIL_SPRING;pub use navigation_rail::RailDestination;pub use navigation_rail::RailFab;pub use navigation_rail::RailLabelBehavior;pub use navigation_rail::RailSection;pub use navigation_rail::rail_destination;pub use navigation_rail::rail_fab;pub use navigation_rail::rail_section;pub use overlay::ANCHORED_ENTER_SCALE;pub use overlay::AnchoredOverlayView;pub use overlay::AnchoredOverlayWidget;pub use overlay::ModalDismiss;pub use overlay::OVERLAY_ANCHOR_GAP;pub use overlay::OVERLAY_DIALOG_MAX_WIDTH;pub use overlay::OVERLAY_DIALOG_MIN_WIDTH;pub use overlay::OVERLAY_EDGE_FRACTION;pub use overlay::OVERLAY_FLING_VELOCITY;pub use overlay::OVERLAY_HANDLE_RESERVE;pub use overlay::OVERLAY_SCRIM_ALPHA;pub use overlay::OVERLAY_SHEET_MAX_HEIGHT_FRACTION;pub use overlay::OVERLAY_SIDE_SHEET_MAX_WIDTH;pub use overlay::OverlayAlign;pub use overlay::OverlayAnchor;pub use overlay::OverlayAnchorView;pub use overlay::OverlayAnchorWidget;pub use overlay::OverlayBorder;pub use overlay::OverlayContainer;pub use overlay::OverlayCorners;pub use overlay::OverlayElevation;pub use overlay::OverlayEntrance;pub use overlay::OverlayExtent;pub use overlay::OverlayGeometry;pub use overlay::OverlayLimit;pub use overlay::OverlayModalConfig;pub use overlay::OverlayModalContent;pub use overlay::OverlayModalView;pub use overlay::OverlayModalWidget;pub use overlay::OverlayPlacement;pub use overlay::OverlayRole;pub use overlay::OverlaySide;pub use overlay::anchored_overlay;pub use overlay::overlay_anchor;pub use overlay::overlay_modal;pub use overlay::place_anchored;pub use overlay::show_overlay_modal;pub use progress::AmplitudeCurve;pub use progress::CircularProgress;pub use progress::CircularProgressView;pub use progress::CircularProgressWidget;pub use progress::CircularWavyProgress;pub use progress::LinearProgress;pub use progress::LinearProgressView;pub use progress::LinearProgressWidget;pub use progress::LinearWavyProgress;pub use progress::ProgressSize;pub use progress::ProgressValue;pub use progress::circular_progress;pub use progress::circular_wavy_progress;pub use progress::linear_progress;pub use progress::linear_wavy_progress;pub use radio::Radio;pub use radio::RadioView;pub use radio::RadioWidget;pub use radio::radio;pub use refresh_indicator::RefreshIndicatorView;pub use refresh_indicator::RefreshIndicatorWidget;pub use refresh_indicator::refresh_indicator;pub use search::DockedSearchViewView;pub use search::FULL_SCREEN_HEADER_HEIGHT;pub use search::SEARCH_BAR_MIN_HEIGHT;pub use search::SEARCH_BAR_MIN_WIDTH;pub use search::SEARCH_VIEW_COMPACT_MAX_WIDTH;pub use search::SEARCH_VIEW_HEIGHT_FRACTION;pub use search::SEARCH_VIEW_MIN_HEIGHT;pub use search::SEARCH_VIEW_MIN_WIDTH;pub use search::SearchBarView;pub use search::SearchBarWidget;pub use search::SearchView;pub use search::SearchViewContentWidget;pub use search::SearchViewMode;pub use search::SearchViewView;pub use search::search_bar;pub use search::search_view;pub use search::show_search_view;pub use segmented_button::MAX_SEGMENTS;pub use segmented_button::MIN_SEGMENTS;pub use segmented_button::Segment;pub use segmented_button::SegmentedButton;pub use segmented_button::SegmentedButtonView;pub use segmented_button::SegmentedButtonWidget;pub use segmented_button::segment;pub use selection::SelectionAppBarView;pub use selection::SelectionAppBarWidget;pub use selection::SelectionHostView;pub use selection::SelectionHostWidget;pub use selection::selection_app_bar;pub use selection::selection_host;pub use shapes::CornerRounding;pub use shapes::RoundedPolygon;pub use sheet::BottomSheetView;pub use sheet::BottomSheetWidget;pub use sheet::bottom_sheet;pub use sheet::show_bottom_sheet;pub use side_sheet::SIDE_SHEET_WIDTH;pub use side_sheet::SideSheetView;pub use side_sheet::show_side_sheet;pub use side_sheet::side_sheet;pub use slider::RangeSliderView;pub use slider::RangeSliderWidget;pub use slider::Slider;pub use slider::SliderIconPosition;pub use slider::SliderRange;pub use slider::SliderTrackIcons;pub use slider::SliderTrackKind;pub use slider::SliderView;pub use slider::SliderWidget;pub use slider::centered_slider;pub use slider::range_slider;pub use slider::slider;pub use slider::vertical_centered_slider;pub use slider::vertical_slider;pub use slider::wavy_centered_slider;pub use slider::wavy_range_slider;pub use slider::wavy_slider;pub use snackbar::SnackbarController;pub use snackbar::SnackbarHostView;pub use snackbar::SnackbarHostWidget;pub use snackbar::SnackbarMessage;pub use snackbar::snackbar;pub use snackbar::snackbar_host;pub use split_button::CHEVRON_OPEN_TURNS;pub use split_button::CHEVRON_ROTATION_DURATION;pub use split_button::SPLIT_ELEVATED_INNER_GAP;pub use split_button::SPLIT_FOCUS_RING_OUTSET;pub use split_button::SPLIT_INNER_GAP;pub use split_button::SPLIT_MIN_TAP_TARGET;pub use split_button::SPLIT_SHAPE_SPRING;pub use split_button::SplitButton;pub use split_button::SplitButtonItem;pub use split_button::SplitButtonMenuRoute;pub use split_button::SplitButtonMenuStyle;pub use split_button::SplitButtonShape;pub use split_button::SplitButtonSize;pub use split_button::SplitButtonTrailingAlignment;pub use split_button::SplitButtonVariant;pub use split_button::SplitButtonView;pub use split_button::SplitButtonWidget;pub use split_button::TRAILING_SELECTED_CORNER_PERCENT;pub use switch::Switch;pub use switch::SwitchView;pub use switch::SwitchWidget;pub use switch::switch;pub use tabs::MIN_TABS;pub use tabs::Tab;pub use tabs::Tabs;pub use tabs::TabsVariant;pub use tabs::TabsView;pub use tabs::TabsWidget;pub use tabs::tab;pub use tabs::tabs;pub use text_field::TextField;pub use text_field::TextFieldVariant;pub use text_field::TextFieldView;pub use text_field::TextFieldWidget;pub use text_field::text_field;pub use time_picker::DIAL_SIZE;pub use time_picker::DIAL_SLOTS;pub use time_picker::DIALOG_LANDSCAPE_WIDTH;pub use time_picker::DIALOG_PORTRAIT_WIDTH;pub use time_picker::HEADER_LANDSCAPE_WIDTH;pub use time_picker::TimeDialView;pub use time_picker::TimeDialWidget;pub use time_picker::TimeEntry;pub use time_picker::TimeInputView;pub use time_picker::TimeInputWidget;pub use time_picker::TimeOfDay;pub use time_picker::TimePicker;pub use time_picker::TimePickerEntryMode;pub use time_picker::TimePickerMode;pub use time_picker::TimePickerOrientation;pub use time_picker::TimePickerStrings;pub use time_picker::TimePickerView;pub use time_picker::show_time_picker;pub use time_picker::time_dial;pub use time_picker::time_input;pub use time_picker::time_picker;pub use toggle_button::ToggleButton;pub use toggle_button::ToggleButtonSize;pub use toggle_button::ToggleButtonView;pub use toggle_button::ToggleButtonWidget;pub use toolbar::DockedToolbar;pub use toolbar::FloatingToolbar;pub use toolbar::TOOLBAR_DOCKED_PAD_X;pub use toolbar::TOOLBAR_EXPAND_SPRING;pub use toolbar::TOOLBAR_FAB_BASELINE;pub use toolbar::TOOLBAR_FAB_MEDIUM;pub use toolbar::TOOLBAR_FLOATING_PAD;pub use toolbar::TOOLBAR_GAP;pub use toolbar::TOOLBAR_HEIGHT;pub use toolbar::TOOLBAR_MAX_INLINE_ACTIONS;pub use toolbar::TOOLBAR_REVEAL_FADE_START;pub use toolbar::TOOLBAR_SCREEN_OFFSET;pub use toolbar::TOOLBAR_SETTLE_VELOCITY;pub use toolbar::TOOLBAR_TO_FAB_GAP;pub use toolbar::ToolbarAction;pub use toolbar::ToolbarColorStyle;pub use toolbar::ToolbarColors;pub use toolbar::ToolbarElevation;pub use toolbar::ToolbarExitDirection;pub use toolbar::ToolbarFabPosition;pub use toolbar::ToolbarMorph;pub use toolbar::ToolbarPartition;pub use toolbar::ToolbarScrollHide;pub use toolbar::ToolbarSize;pub use toolbar::ToolbarVariant;pub use toolbar::ToolbarView;pub use toolbar::ToolbarWidget;pub use toolbar::docked_toolbar;pub use toolbar::floating_toolbar;pub use toolbar::partition_actions;pub use toolbar::toolbar_action;pub use tooltip::RichTooltipView;pub use tooltip::TooltipAction;pub use tooltip::TooltipHover;pub use tooltip::TooltipTriggerView;pub use tooltip::TooltipTriggerWidget;pub use tooltip::TooltipView;pub use tooltip::rich_tooltip;pub use tooltip::tooltip;pub use tooltip::tooltip_action;pub use tooltip::tooltip_trigger;
Modules§
- appbar
- The M3 Expressive app bar family: four constructors over one set of metrics, shape families, and densities.
- badge
- The Material 3 Expressive
Badge: a small dot or numeric indicator anchored to the top edge of any child view. - button
- The Material 3 Expressive button: the catalog’s flagship control.
- button_
group - The Material 3 Expressive button group: a row (or column) of
crate::toggle_buttonmembers,standard(spaced) orconnected(shared-edge), with the reference’s neighbor-squish press animation. - card
- The M3
Cardcontainer: elevated / filled / outlined variants, wrapping a singlefrust::authoring::AnyViewchild (the same single-childChildPodwrapper shape asfrust::Padding). - card_
list - The M3E card list: a vertical stack of card-backed rows whose corner radii vary by position — the first and last cards keep a large outer radius on their outward edges, while every adjoining edge takes a small inner radius, so a run of cards reads as one grouped surface.
- carousel
- The M3 Expressive carousel: a snapping row (or column) of items whose
extents morph as they cross the viewport, in the three reference layouts —
hero,contained, anduncontained. - checkbox
- The M3(E)
Checkbox: a controlled component supporting the binary (Some(bool)) and, viatristate_checkbox, the tristate (Option<bool>,None= indeterminate) shapes, plus anerrorflavor — an 18dp box with a 40dp state-layer halo, animated container fill/border and check-mark draw. - chips
- M3
Chip: four types (assist, filter, input, suggestion), anelevatedmodifier, and aselectedstate — a 32dp height, 8dp corner radius pill-shaped control with the sharedsuper::state_layerinteraction overlay. - date_
picker - The M3 Expressive date picker: a calendar month grid with a year selector, a text-input mode, and the modal dialog that presents either.
- dialog
- The M3(E) dialog family, on the merged
crate::overlay::modalhost: the basic/centered dialog (dialog/show_dialog, migrated off the old standalonepush_transparent_for_resultpath), a full-screen dialog (full_screen_dialog/show_full_screen_dialog), and a selection/list dialog (selection_dialog/show_selection_dialog). - dismissible
- The M3E dismissible wrapper: drag a row horizontally to reveal a per-direction background, release past the commit line to send it away.
- divider
- The Material 3 Expressive
Divider: a thin line grouping content in lists and containers, in either orientation, with optional leading/ trailing insets. - dropdown
- The Material 3 Expressive dropdown menu: a text-field-shaped trigger and the option panel it anchors — single-select, multi-select with chips inside the field, type-to-filter search, and async option loading.
- expandable_
list - The M3E expandable list: a stack of card-backed disclosure items, each a pressable header row with a rotating chevron over a spring-revealed body.
- fab
- The M3 Expressive
FloatingActionButton: three container sizes (small 40dp / medium 56dp / large 96dp), four container colors, a spring press scale, elevation that lifts on hover, and an animatable corner-radius override seam — plusextended_fab’s pill-shaped variant, whose label animates open/closed. - fab_
menu - The Material 3 Expressive FAB menu: a trigger FAB that reveals a
vertical stack of large menu items on tap, replacing the older speed-dial
pattern (m3.material.io/blog/building-with-m3-expressive; Compose
FloatingActionButtonMenu). - icon_
button - The Material 3 Expressive icon button: 4 variants × 5 sizes × round/
square × 3 widths, with toggle (selected-icon swap), a badge slot, and
the same press/hover shape morph
crate::buttonuses. - icons
- Vendored Material Design Icons — GENERATED, do not hand-edit.
- interaction
- The unified M3(E) interaction substrate: hover/focus/pressed/dragged
tracking, an M3E-precedence state-layer opacity resolver, an optional
press-scale spring spec, and a pluggable haptics hook. Modeled on the
reference’s
M3ETappable/M3EStateLayer/M3EHapticsfoundations (tmp/material_3_expressive/lib/foundations/m3e_tappable.dart,m3e_state_layer.dart,m3e_haptics.dart), unified here into one substrate every interactive component in this crate builds on, rather than each hand-rolling its own copy of the same four booleans. - list_
item ListItemrows: 1/2/3-line variants at 56/72/88dp heights, meant to pair withfrust::ListVieworsuper::card_list.- list_
view - Deprecated compatibility shim:
ListViewmoved to the framework’s baseline widget set (frust::ListView/frust::ListViewWidget/frust::list_view) well before this catalog existed as its own crate. Kept only so an existingfrust_material::list_view::…call site still resolves. - loading_
indicator - The Material 3 Expressive loading indicator: a continuously-morphing,
continuously-rotating sequence of seven Material shapes, driven by the
crate’s
Morphfeature-point engine. - menu
- The Material 3 Expressive menu: the node tree, its two color styles, and the anchored menu that presents them.
- navbar
- The Material 3 Expressive bottom
NavigationBar: two container heights, three label behaviors, three selection-indicator styles, per-item badges, and the liquid selection indicator — a two-spring pill that stretches into a bridge between the outgoing and incoming destination and then settles onto the new one. - navigation_
drawer - The Material 3 Expressive navigation drawer: a fixed-width destination
list sliding in from the leading (left) screen edge, sharing its liquid
selection indicator with
crate::navigation_rail. - navigation_
rail - The M3 Expressive navigation rail: a vertical destination column that animates between a slim collapsed icon rail and a wide expanded icon-plus-label rail, optionally presenting the expanded state modally over a scrim.
- overlay
- The shared overlay hosting seam: the two patterns every Material panel that leaves its parent’s box is built on, plus the token accessors those panels paint from.
- progress
- The Material 3 Expressive progress indicators: linear and circular, each flat or wavy, each determinate or indeterminate — the reference’s four named constructors over two widgets.
- radio
- The M3
Radiobutton: a generic value/group-value single-selection control with an optional label slot, an error flavor, and an inner-dot scale-in animation. - refresh_
indicator - M3E pull-to-refresh: a wrapper around a scrollable child that shows the
crate::loading_indicatorspinner while the app’s async refresh runs, triggered by pulling past the baseline’s own overscroll trigger. - search
- The M3 Expressive search family: the search bar (a pill-shaped field affordance) and the search view it opens (a full-screen route on compact widths, an anchored panel on expanded ones).
- segmented_
button - The Material 3 Expressive segmented button: a row of 2-5 connected segments for selecting an option, switching a view, or sorting — single- or multi-select, with an optional checkmark on the selected member(s).
- selection
- The M3E selection pattern: an index-set selection mode over a list of items, entered by a long-press and exited by clearing the selection, plus the contextual bar that swaps in over an idle app bar while it is active.
- shapes
- Feature-point rounded-polygon geometry: the substrate the Material 3 Expressive shape catalog and its feature-matched morphing are built on.
- sheet
- The modal M3
BottomSheet: a full-area widget = scrim (32% scrim-color fill, fading with the panel’s own spring) + a bottom-anchored panel (top corners extra-large 28dp,surfaceContainerLow, a centered drag handle 32dp wide × 4dp tall in a 48dp touch target), pushed as a transparent navigator page viaNavigatorController::push_transparent_for_result.show_bottom_sheetwraps the push. - side_
sheet - The modal M3 side sheet: secondary content anchored to the trailing (right) edge of the screen, sliding in from that edge over the M3 32% scrim.
- slider
- The Material 3 Expressive
Slider: a controlled value picker painted as a segmented track with a bar handle, a floating value indicator, and (optionally) discrete stops or a relocating end icon — horizontal or vertical, flat or wavy. - snackbar
- The Material 3 Expressive
Snackbar: a transient, low-emphasis bottom message with an optional single action and an optional close affordance. - split_
button - The Material 3 Expressive split button: a leading action segment joined to a trailing menu-trigger segment across a hairline gap, reading as one connected shape.
- state_
layer - The shared M3 interaction-state overlay: a fill painted over a widget’s shape, in the widget’s own content color, at an opacity selected by its current hover/focus/pressed/dragged interaction state.
- switch
- The Material 3 Expressive
Switchtoggle: a controlled component reporting a requested on/off value, painted as a 52×32dp track with a spring-driven thumb (16dp unselected / 24dp selected, 32dp while pressed) and the sharedsuper::state_layerinteraction overlay. - tabs
- The Material 3 Expressive tab bar:
TabsVariant::Primary(an indicator pill sized to each tab’s own label/icon content, matchingm3e_tab_theme.dart’sindicatorFullWidth == false) andTabsVariant::Secondary(a full-width underline spanning the whole tab slot). The active indicator slides between tabs on selection change — see the Indicator slide section — and each tab paints aprimary-tinted state layer while pressed. - text_
field - The M3 Expressive text field: filled and outlined variants, a floating
label, leading/trailing icon slots, supporting text and an error state,
painted as decoration around the framework’s own
frust::text_input. - time_
picker - The M3E time picker: a clock dial (
dial), a text entry form (input), and the modal dialog that presents either of them (time_picker/show_time_picker). - toggle_
button - The Material 3 Expressive toggle button: a controlled on/off control that morphs its container between a round (unchecked) and a square (checked) shape, in any of the five button style variants.
- toolbar
- The M3 Expressive floating/docked toolbar
(m3.material.io/components/toolbars/specs; Compose
HorizontalFloatingToolbar/FlexibleBottomAppBar). - tooltip
- Material 3 Expressive tooltips: a plain, auto-dismissing label and a rich panel with a title, supporting text and up to two action buttons — both opened by hovering (pointer platforms) or a long-press (touch), and floated above the app by the framework’s overlay portal.
Structs§
- Core
Palette - The six tonal ramps a Material scheme is drawn from.
- Hct
- A color in HCT: hue (0..360), chroma (0..~130, hue- and tone-dependent), tone (0..100, L* from L*a*b*).
- Material
Dimensions - Material 3 Expressive dimension tokens: spacing and radius scales.
Reference: Material 3 Expressive design tokens (verified 2026-08-19,
material_3_expressive/lib/foundations/m3e_dimensions.dart). - Material
Semantic Colors - The nine M3E roles
ColorSchemehas no field for — one brightness’s worth. Carried bysuper::extension::MaterialTokensas itslight/darkfields; see module docs for how each is sourced. - Material
Spacing - Material 3 Expressive spacing scale (6-step tokens). Values are in logical pixels (dp).
Reference: Material 3 Expressive design tokens (verified 2026-08-19, matching
material_3_expressive/lib/foundations/m3e_spacing.dart). - Material
Spring - A Material 3 Expressive spring preset:
stiffnessplusdamping_ratio(mass implicitly1.0— see the module docs).1.0is critically damped (no overshoot); values below1.0overshoot before settling. - Material
Tokens - The Material 3 Expressive semantic-role theme extension:
MaterialSemanticColorsfor both brightnesses at once, exactly likefrust::Theme’s ownlight/darkpair. Recovered from a themed app withtheme.extension::<MaterialTokens>(). - Tonal
Palette - One Material tonal ramp: a fixed hue and chroma, sampled by tone.
Enums§
- Material
Motion - The M3 Expressive duration/easing token namespace — an uninhabited type
(no instance is ever constructed) carrying only associated constants,
mirroring the Dart source’s
abstract final class M3EMotionstatic namespace. See the module docs for the full Dart → Rust naming map and source citation.
Functions§
- baseline
- The Material 3 baseline theme: baseline light/dark color schemes, the M3
type scale (built from
TextStyle::default()), the M3 shape scale, the M3 elevation table, and the M3 Expressive motion scheme. Starts inBrightness::Light. Attachesstatus_palette,MaterialTokens::material, and [native_typefaces] as pre-populated extensions (seeTheme::extension), soextension::<StatusPalette>(),extension::<MaterialTokens>(), andextension::<NativeTypefaces>()are alwaysSomeon this baseline. See module docs’s “Two semantic vocabularies” section for why the first two both carryinfo/success/warningfields at different values — that is by design, not a conflict. - color_
scheme_ dark - The Material 3 baseline dark
ColorScheme(seed#6750A4). - color_
scheme_ light - The Material 3 baseline light
ColorScheme(seed#6750A4). - elevation
- The Material 3 baseline elevation table (dp values verified; shadow math
and surface-role assignment are this crate’s documented v1 mapping — see
[
elevation_level]’s doc comment). - from_
seed - Generate a Material 3 color scheme from any seed color.
- install
- Make Material 3 this app’s starting design system.
- motion_
scheme - The Material 3 Expressive baseline motion scheme: six spring presets
(of
MaterialMotion/MaterialSpring’s full 34-token M3E table — see their own module doc for the source citation and the Dart → Rust naming map). - shape_
scale - The Material 3 shape scale: 10 corner-radius tokens (post-Expressive scale). Source: https://m3.material.io/styles/shape/corner-radius-scale (verified 2026-07-17; the pre-Expressive scale had 7 tokens, not 10). Radii are dp, treated 1:1 as logical px.
- status_
palette - The Material 3 baseline
StatusPalettedefault: success/warning/info color roles Material 3’s baseline 46-roleColorSchemehas no fixed slot for. - theme_
from_ seed super::baselinewith its colors regenerated fromseed: the same M3 type scale, shape scale, elevation table, motion scheme andsuper::status_palette, with both color schemes and theMaterialTokensextension seeded instead of hand-baked, starting atbrightness.- type_
scale - Builds the Material 3 baseline type scale from
base(itsstyle/color/alignare preserved on every token;size/weight/letter_spacing/line_height/familyare all Material-specified —familyis overridden to the bundled Roboto Flex stack regardless ofbase, see this module’s “Family: Roboto Flex” doc section for why).