Skip to main content

Module ui_kit

Module ui_kit 

Source
Expand description

The UI refresh’s components and the developer gallery that shows them. The refreshed UI’s components (section 5).

STATUS: rollout step 1. The components exist and are shown in the developer gallery (gallery); no panel calls them yet. form.rs’s helpers become wrappers over them in step 3, after the owner has signed off on the look.

Every component reads its colours, sizes and durations from the crate::theme::Theme of its Ui (crate::theme::Theme::of) and returns the egui::Response of the control, so a caller publishes its automation hit key from the rect exactly as it does for the egui widget it replaces. Enumerations are dropdowns; there is no radio row here by design.

Re-exports§

pub use button::Button;
pub use button::Size;
pub use button::Variant;
pub use chips::reference_field;
pub use chips::Chip;
pub use chips::ReferenceField;
pub use chips::ReferenceOutput;
pub use dropdown::dropdown;
pub use dropdown::Dropdown;
pub use icon_button::BarSide;
pub use icon_button::IconButton;
pub use input::number_input;
pub use input::search_input;
pub use input::text_input;
pub use input::NumberInput;
pub use input::TextInput;
pub use tabs::document_tabs;
pub use tabs::tab_bar;
pub use tabs::DocumentTab;
pub use tabs::DocumentTabsOutput;
pub use toggle::checkbox;
pub use toggle::slider;
pub use toggle::switch;
pub use toggle::Check;

Modules§

button
Buttons: primary, secondary, ghost and danger, in two sizes, with an optional leading icon, trailing shortcut text and a busy state.
chips
The look of a reference-selection field: picked items as chips that wrap, an accent border that pulses while the field is picking, and a collapsed count once there are more than six picks. The picking itself stays in reference_selection; this is only how the field is drawn.
dropdown
Dropdowns: the one control for an enumeration. The closed control looks like an input with a chevron that turns when open; the popup is a raised card of 28 px rows with an accent check on the current value, caption headers for groups, and a search field once the list passes twelve items.
gallery
The developer gallery: every component in every state, in both themes and both densities, with the four open decisions (spec section 9) as dropdowns so the owner can try each option, and a switch that previews the theme on the whole app.
icon_button
Icon buttons for the ribbon (32 px), toolbars and rails (28 px): a square hit area, the icon centred, a rounded hover square, and an accent bar when the tool is active.
input
Text and number inputs: a bg.input field with a 1 px border that turns accent on focus, an error state that keeps the user’s text, a search variant, and numbers with the unit inside the field.
paint
The shapes the components share: focus ring, tick, cross, chevron, magnifier, spinner and catalogued icons. Marks are drawn as paths, never as font glyphs, so they look the same with any font.
preview
The four open decisions (spec section 9) as values, the fonts each font option draws with, and the whole-app PREVIEW of the theme.
surface
Surfaces: cards and sections, panel headers, popup and menu rows, the dialog frame, toasts and tree rows.
tabs
Tabs: workbench and panel tabs with a sliding accent underline, and document tabs as pills joined to the content below. Tabs never squash or wrap: the ones that do not fit go into a chevron menu.
toggle
Checkbox, switch and slider.

Enums§

Show
A state a component is DRAWN in whatever the pointer is doing: the gallery uses it to show hover, pressed and focus side by side. Panels leave it at Show::Live.

Functions§

themed
Run contents with theme as the theme of every component in it and its egui style on the Ui, whatever the app’s own style is.