Skip to main content

Crate gpui_kit_material

Crate gpui_kit_material 

Source
Expand description

Material 3 adapters for Longbridge GPUI Kit.

The kit is layered so each layer can be replaced without touching the ones above it:

LayerModuleHolds
Colorcolor (gpui-kit-material-color)palettes, roles, scheme derivation
Themethemethe painted scheme, palette transitions, theme::color
Tokenstokensshape, type scale, layout metrics, elevation, state layers
MotionmotionM3 springs, entrances, retargetable values
IconsiconsGoogle Material Symbols through icons::Assets
ComponentscomponentsMaterial presentation over Kit components and Base parts

Reuse [gpui_kit::component] controls where their presentation hooks meet the Material contract; [gpui_base] supplies behavior for uncovered parts. This kit owns the Material appearance and motion, not another generic UI runtime.

Call gpui_kit::init and then init once at startup. Use Kit’s open_window for the single Root, register icons::Assets, and initialize theme::init_component_theme before Root’s first render. Advance theme::advance_component_theme from input events and pre-frame callbacks. Base-only consumers can paint with theme::apply_scheme at the start of each root render.

Re-exports§

pub use gpui_kit_material_color as color;

Modules§

components
Material components. Each module documents the M3 component it implements and what remains for M3 Expressive (docs/ROADMAP.md).
icons
Material Symbols rendered through Longbridge Kit’s Component Icon.
motion
The motion vocabulary: M3 springs, entrances and retargetable values.
prelude
The roles, tokens and components most pages need, including the theme::color lookup. The crate root’s color is the color module.
theme
The painted scheme: what color returns on the current frame.
tokens
Design tokens. Geometry is in px where it must not follow the text scale and in rems (14px = 1rem at 100%) where it shares a ruler with text.

Functions§

init
Register the kit’s key bindings. Call once, before opening windows.