Skip to main content

Crate ferroui_themes_material

Crate ferroui_themes_material 

Source
Expand description

Android Material 3 Expressive for FerroUI.

Independent compiled XAML theme derived from FerroUI’s WinUI template contracts. Visual reference: AndroidX Material3 1.5.0-beta02 (2026-10-21). See docs/porting/material-theme.md for component coverage and fidelity limits.

ⓘ
use ferroui_themes_material::{MaterialTheme, MaterialAppBuilderExtension};
// Add .with_material_fonts() to your AppBuilder.
application.styles().add(MaterialTheme::new().as_style());

Re-exports§

pub use ripple::MaterialRipple;
pub use motion::MaterialMotionScheme;
pub use motion::MaterialMotionRole;
pub use motion::MaterialSpringSpec;
pub use motion::MaterialSpringSample;
pub use motion::MaterialSpringState;
pub use motion::MaterialSpringEasing;

Modules§

accents
converters
The value converters of the WinUI theme: the converters of microsoft-ui-xaml that the theme resources name and FerroUI’s control set has no counterpart of (docs/porting/winui-theme.md, section 5). Markup names them with xmlns:winuiconverters="using:FerroUI.Themes.Material.Converters".
motion
Material 3 Expressive motion, connected to FerroUI’s transition and compositor APIs.
primitives
The primitives of WinUI that the templates of the theme use and FerroUI’s control set has no counterpart of (Microsoft.UI.Xaml.Controls.Primitives of microsoft-ui-xaml). Markup names them with xmlns:primitives="using:FerroUI.Themes.Material.Primitives".
ripple
The pointer and keyboard press indication used by Material control templates.

Structs§

ExcludedDocument
A control theme document that is embedded but not part of the theme yet, because it names types that are not ported or is not finished.
MaterialAppBar
Place this bar above its ScrollSource in an Auto,* grid. Navigation and Actions are ordinary controls: commands, keyboard focus and automation remain their own. The scroll source is weak. A drag consumes app-bar pre-scroll, then child scroll, then leftover app-bar post-scroll; horizontal gestures remain with the child.
MaterialAppBarFling
Native Android spline decay, including its 100-sample interpolation and millisecond clock.
MaterialAppBarLayout
The app-bar template’s four slots: navigation, compact title, actions, expanded title clip.
MaterialAppBarState
A serializable scroll snapshot. Deltas follow finger movement: up is negative. The offset is always between the negative collapse limit and zero.
MaterialBottomSheetAutomationPeer
A sheet remains a pane, with native children and explicit expansion actions.
MaterialBottomSheetHost
A modal sheet placed as the last child of the application’s overlay Grid. Its Content is the sheet body. State is the requested semantic state; Self::current_state changes when the transition settles.
MaterialChip
Attached slots and optional dismissal for the Material chip themes. A selectable chip retains the native ToggleButton pattern with a checkbox role; an assist/suggestion chip retains Button’s invoke pattern.
MaterialChipDismissButton
Template button with a separate invoke/command path; activation never bubbles a chip-body Click and never toggles/removes the body implicitly.
MaterialChipLayout
MaterialColorScheme
MaterialCornerRadiusTransition
A physical spring transition with independent velocity for all four corner radii.
MaterialDateCell
A native Button with a selection-item automation contract. The 48dp hit cell is deliberately larger than its 40dp day surface (72x36dp for a year).
MaterialDateCellAutomationPeer
MaterialDateInputFormat
Native date input always uses two-digit month/day and four-digit year in the culture’s order. Eight underlying digits are displayed with two delimiters.
MaterialDateMonthView
A six-row month. Empty leading and trailing cells are layout space, without selectable dates from adjacent months. Range paint is behind the real buttons.
MaterialDateMonthsPanel
Physical scroll extent for all months, with only visible months plus one on each side realized. The native 48dp subhead + 288dp calendar yields a 336dp stride.
MaterialDatePicker
Embed directly, or enable ShowActions in a dialog/sheet. SelectedDate aliases SelectedStartDate; end dates are inclusive. SelectionChanged is raised for edits; Confirmed/Dismissed let the application own modal lifetime and committed values.
MaterialDatePickerAutomationPeer
MaterialDatePickerState
A restorable native selection snapshot. End dates are inclusive. An incomplete range has a start and no end; an invalid or reversed programmatic range clears both ends.
MaterialDoubleTransition
A physical spring transition for scalar properties, including opacity and switch geometry.
MaterialDynamicColorOptions
Inputs for a generated dynamic scheme. Contrast is in [-1, 1]: zero is standard, 0.5 is medium, and 1 is high contrast. NaN/infinite/out-of-range values are rejected.
MaterialDynamicPalette
All five Android tonal palettes, including the full neutral and neutral-variant ranges. The Android 31–33 mapping deliberately uses neutral-variant surfaces, as AndroidX does, rather than the older system’s lower-chroma neutral palette.
MaterialExtendedFab
A normal Button with an icon, a label in Content, and an animated expanded state. Commands, keyboard activation, routed Click and the invoke automation pattern are inherited.
MaterialExtendedFabLayout
Two-child layout used by the extended-FAB template: icon first, label second. It measures the expanded label at full available width while reporting an interpolated width. The container’s rounded trailing edge therefore follows the animation naturally.
MaterialLoadingIndicator
A Material loading indicator with native 48dp container and 38dp active size. Value, Minimum, Maximum, and range accessibility come from RangeBase; Percentage provides a convenient 0–100 alias independent of that range.
MaterialProgressIndicator
Renderer used by the Material ProgressBar control themes. The enclosing ProgressBar owns range semantics and automation; this noninteractive visual consumes its percentage and state without changing that control’s behavior.
MaterialRangeSlider
A bounded range selected by two focusable Material slider handles.
MaterialRangeSliderLayout
Template panel drawing native track segments and positioning the two 48dp input cells.
MaterialRangeSliderThumb
A real range control used for one endpoint, with its own focus and RangeValue provider.
MaterialRangeSliderThumbAutomationPeer
MaterialSearchView
A 56dp search field with an animated docked results surface. Content supplies the application’s results; Query is two-way bindable. Query submission is a routed event, so filtering can remain in the view model. The same TextBox survives expansion, preserving composition, undo and selection.
MaterialSegmentedContent
Two-child layout: an 18 dp check, then the label. Its width always reserves the check and 8 dp gap. An unchecked label is centered by a 13 dp logical offset. Check removal is immediate; check entry has its own scale and opacity springs.
MaterialSegmentedGroup
A Material segmented row. Use RadioButton children for single choice (the default), or set IsMultiSelect="True" and use ToggleButton children for independent choices.
MaterialSegmentedGroupAutomationPeer
Group selection provider while its children retain native radio/toggle peers.
MaterialSelectionMark
MaterialSheetAnchors
Sheet top coordinates in a viewport, expressed in device-independent pixels.
MaterialSnackbar
The lookless visual for a snackbar. The host owns request lifetime; its template owns message wrapping, optional action/dismiss buttons, and single/two-row composition.
MaterialSnackbarFuture
Awaitable request. Cancelling a pending future removes its active or queued message.
MaterialSnackbarHandle
Identity-stable access to one queued request. Its operations never address a successor.
MaterialSnackbarHost
A XAML-friendly host for a FIFO queue of Material snackbars. Place it in the bottom row or overlay of the application’s existing layout. At most one request is actionable; outgoing visuals may overlap during their exit fade.
MaterialSnackbarMessage
Content/options for a queued snackbar. duration: None selects the native default: short without an action, indefinite with an action.
MaterialTextField
Attached Material text-field decoration. Works on the existing TextBox; choosing a theme does not replace the editor or its automation peer.
MaterialTextFieldBorder
MaterialTextFieldLayout
Arranges a real text editor together with Material decoration. In particular, outlined labels interpolate from the editor’s start edge to the 16dp outline inset, independently of leading-icon and prefix widths. Supporting content contributes to the control’s height without stretching the painted container.
MaterialTheme
Includes the Android Material theme in an application.
MaterialThicknessTransition
A physical spring transition with independent velocity for all four thickness components.
MaterialTimeChangedEventArgs
MaterialTimePicker
A persistent, minute-precision time editor with an analog dial and numeric input. Hour is always 0–23, even when the display uses AM/PM. Invalid intermediate text is retained separately; SelectedTime and TimeChanged expose only valid values.
MaterialTimePickerAutomationPeer
MaterialTimePickerDial
Template panel displaying the dial and twenty-four individually selectable hour/minute nodes.
MaterialTimePickerField
TextBox subclass keeps the platform editor, IME, clipboard, selection, and value provider.
MaterialTimePickerLayout
Native measured layout, including compact landscape dial sizing and RTL outer layout.
MaterialTimePickerNumber
Each clock value retains RadioButton’s selection-item automation contract.
MaterialTimePickerNumberAutomationPeer
A clock number exposes selection and the distinct native semantic click. Invoking may advance to minutes; selection and keyboard activation do not.
MaterialTonalPalette
An imported or HCT-generated tonal palette. Imported ARGB values are preserved exactly. Sparse palettes are supported, but scheme creation fails for missing tones.

Enums§

DensityStyle
Layout density. Both modes preserve Material’s minimum 48dp touch targets.
MaterialAndroidColorError
A native import failure. Existing theme colors remain installed when an import fails.
MaterialAndroidColorSource
Which native Android resource contract supplied a dynamic color scheme.
MaterialAppBarScrollBehavior
MaterialAppBarSize
MaterialChipKind
MaterialColorRole
MaterialColorSpec
Source-spec selection for locally generated phone schemes. The default is exactly Google’s DynamicScheme.DEFAULT_SPEC_VERSION at the pinned commit. This never changes imported Android colors or the AndroidX baseline schemes.
MaterialDatePickerMode
MaterialDateSelectionMode
MaterialDynamicColorError
A failed import identifies the exact missing tone or role; it never substitutes an unrelated color or interpolates missing platform tones in RGB.
MaterialExtendedFabSize
The three expressive extended-FAB sizes in the pinned component implementation.
MaterialPaletteFamily
MaterialPaletteStyle
Material Color Utilities palette variants. This is independent of the UI motion scheme.
MaterialRangeThumb
MaterialSheetState
The semantic state of a Material bottom sheet.
MaterialSnackbarDuration
Native Material display durations. These describe readable lifetime, not animation duration.
MaterialSnackbarResult
The terminal outcome of one request. Cancellation is distinct from user dismissal.
MaterialStatusColor
The status colors the theme adds to the Material roles, which have no success or warning colors: tonal green and amber, for the severities of InfoBar and InfoBadge.
MaterialTextFieldSlot
A slot of MaterialTextFieldLayout. Each slot has at most one direct child.
MaterialTimeDisplayMode
MaterialTimeSelection

Constants§

MATERIAL_COLOR_UTILITIES_VERSION
Exact upstream source used for palette, tone-delta, and role-contrast rules.
MATERIAL_HCT_SOLVER_VERSION
The separately pinned implementation of the CAM16/HCT gamut solver.

Statics§

ASSEMBLY
What this crate states about itself for markup: its assembly name and the namespace the XML namespace of the framework maps to.

Traits§

MaterialAppBuilderExtension
Adds the embedded Android font family to FerroUI’s cross-platform font manager.
MaterialSnackbarTimeoutPolicy
Adapter for a host’s recommended accessibility timeout. Text and icons are always present; contains_controls means an action label is present, matching the reference host. Return None to require explicit dismissal. Recommendations cannot shorten the base duration.

Functions§

circular_indeterminate_frame
Rotation in degrees and sweep fraction for the 6-second circular cycle. Android’s keyframes add four 90-degree turns with a 300ms advancing phase and a 1200ms hold; the global rotation runs continuously over six seconds.
excluded_documents
The control theme documents Controls/MaterialControls.xaml does not merge yet, from Controls/excluded.txt.
linear_indeterminate_segments
Start/end fractions of Android’s two indeterminate line segments. The 1750ms cycle, head/tail durations and delays are ported from ProgressIndicator.kt.
loading_indeterminate_frame
Shape index, spring progress, and clockwise rotation in radians. New morphs start every 650ms; continuous global rotation takes 4666ms per revolution. Compose computes a 297ms settling duration for this spring at visibility threshold 0.1, then snaps to its target and holds until the next interval.
register_types
Registers the namespaces, the types, the assembly, the embedded documents and the document loader of this crate (and of the crates it is built on). Cheap and idempotent.