Skip to main content

Module sizing

Module sizing 

Source
Expand description

Semantic size policy: control heights and leading glyph slots.

Components draw their interactive controls at one of three heights and seat leading glyphs in one of two slots, so a table’s row action, a sidebar’s header control, and a composer’s send button read as one family instead of six coincidental heights. The values here are defaults, not constants: an application replaces the policy wholesale before its windows render, and components that legitimately vary (density, embedded chrome) expose builder overrides that win over both.

§Example

gpui_ai::init(cx);
gpui_ai::sizing::SizeTokens::default()
    .with_control_lg(gpui::px(36.))
    .set(cx);

Structs§

SizeTokens
The crate’s size policy: three control heights and two glyph slots.