docs: components index grouped by gallery level, then shape, then name

This commit is contained in:
aiongg
2026-11-13 12:48:25 +00:00
parent 409e1c9d67
commit 02eb68052e
4 changed files with 268 additions and 218 deletions
+1 -1
View File
@@ -256,7 +256,7 @@ impl Catalog {
const KIT_MODULES: [&str; 1] = ["testing::layout"];
/// Whether `module` is one of the [`KIT_MODULES`].
pub(crate) fn kit_module(module: &str) -> bool {
fn kit_module(module: &str) -> bool {
library_path(module).is_some_and(|inside| KIT_MODULES.contains(&inside))
}
-2
View File
@@ -83,8 +83,6 @@ pub use items::{ColumnCommands, SweepApply, SweepStep, item_part_open, request_r
pub use label::colon_of;
pub use label::{CellWidth, FieldLabelRole, FieldLayout, GlyphLabel, InsideLabel, LabelKind, LabelScheme, Scrub, SideLabel};
pub use lazy::Lazy;
#[cfg(feature = "testing")]
pub(crate) use level::kit_module;
#[doc(hidden)]
#[cfg(feature = "testing")]
pub use level::{Catalog, CatalogEntry, Level, StoryLayout, Surface, catalog, stale_table_rows, story_title};
+53 -25
View File
@@ -1,4 +1,4 @@
//! The components index: every registered component type with its module and the purpose its derive recorded
//! The components index: every registered component type, grouped by gallery level, with its module and the purpose its derive recorded
//! from the doc comment, and every craft-behavior module with the first sentence of its module docs.
//!
//! The generator binary writes `docs/components-index.md` from [`components_index`] over
@@ -7,7 +7,7 @@
use std::fs;
use std::path::{Path, PathBuf};
use crate::contract::{Registration, kit_module};
use crate::contract::{Level, Registration, catalog};
/// The first sentence of the first paragraph of `lines`, without its final full stop, safe inside a table cell.
fn purpose(lines: &[&str]) -> String {
@@ -34,31 +34,51 @@ fn top_level_files(dir: &Path) -> Vec<PathBuf> {
files
}
/// The components and patterns of `registered`: module, name, shape (`Pattern` for a pattern) and purpose, sorted.
fn registered_rows(registered: &[&'static Registration]) -> Vec<(String, String, String, String)> {
let shown = |name: &'static str| name.rsplit_once("::").map_or(name, |(_, last)| last).to_owned();
let components = registered
.iter()
.filter_map(|registration| registration.probe())
.filter(|probe| !kit_module(probe.module))
.map(|probe| (probe.module.to_owned(), shown(probe.type_name()), format!("{:?}", probe.shape), probe.purpose.replace('|', "\\|")));
let patterns = registered
.iter()
.filter_map(|registration| registration.pattern_probe())
.map(|probe| (probe.module.to_owned(), shown(probe.type_name()), probe.kind.label().to_owned(), probe.purpose.replace('|', "\\|")));
let mut rows: Vec<_> = components.chain(patterns).collect();
rows.sort();
rows.dedup();
/// One row of the registered-types tables.
struct Row {
level: Level,
name: String,
shape: String,
module: String,
purpose: String,
}
/// The shape column's sort position: components by shape, then the pattern kinds.
fn shape_rank(shape: &str) -> usize {
["Leaf", "Body", "Items", "Pattern", "Tool", "Dialog"].iter().position(|known| *known == shape).unwrap_or(usize::MAX)
}
/// The components and patterns of `registered`, ordered by level (the gallery's order), shape, then name.
fn registered_rows(registered: &[&'static Registration]) -> Vec<Row> {
let mut rows = Vec::new();
for entry in catalog(registered).entries {
let level = entry.level;
if let Some(probe) = entry.registration.probe() {
rows.push(Row {
level,
name: entry.name.clone(),
shape: format!("{:?}", probe.shape),
module: probe.module.to_owned(),
purpose: probe.purpose.replace('|', "\\|"),
});
}
if let Some(probe) = entry.registration.pattern_probe() {
rows.push(Row {
level,
name: entry.name.clone(),
shape: probe.kind.label().to_owned(),
module: probe.module.to_owned(),
purpose: probe.purpose.replace('|', "\\|"),
});
}
}
rows.sort_by_cached_key(|row| (row.level, shape_rank(&row.shape), row.name.to_lowercase(), row.module.clone()));
rows
}
/// The types of `registered` that have no purpose: their types lack a doc comment.
pub fn types_without_purpose(registered: &[&'static Registration]) -> Vec<String> {
registered_rows(registered)
.into_iter()
.filter(|(_, _, _, purpose)| purpose.is_empty())
.map(|(module, name, _, _)| format!("{module}::{name}"))
.collect()
registered_rows(registered).into_iter().filter(|row| row.purpose.is_empty()).map(|row| format!("{}::{}", row.module, row.name)).collect()
}
/// The text of `docs/components-index.md` for the workspace at `root` and the types of `registered`.
@@ -66,9 +86,17 @@ pub fn components_index(root: &Path, registered: &[&'static Registration]) -> St
let mut out = String::from("# Built components\n\n");
out.push_str("Generated by `cargo run -p craft-ui-gallery --bin components-index`; edit the doc comments, not this file.\n\n");
out.push_str("## Registered types\n\n| Type | Shape | Module | Purpose |\n|---|---|---|---|\n");
for (module, name, shape, purpose) in registered_rows(registered) {
out.push_str(&table_row(&[&format!("`{name}`"), &shape, &format!("`{module}`"), &purpose]));
out.push_str("## Registered types\n\nGrouped by gallery level, then shape, then name.\n");
let rows = registered_rows(registered);
for level in Level::ALL {
let in_level: Vec<&Row> = rows.iter().filter(|row| row.level == level).collect();
if in_level.is_empty() {
continue;
}
out.push_str(&format!("\n### {}\n\n| Type | Shape | Module | Purpose |\n|---|---|---|---|\n", level.title()));
for row in in_level {
out.push_str(&table_row(&[&format!("`{}`", row.name), &row.shape, &format!("`{}`", row.module), &row.purpose]));
}
}
out.push_str("\n## Behaviours\n\n| Module | Purpose |\n|---|---|\n");
+214 -190
View File
@@ -4,206 +4,230 @@ Generated by `cargo run -p craft-ui-gallery --bin components-index`; edit the do
## Registered types
Grouped by gallery level, then shape, then name.
### Primitives
| Type | Shape | Module | Purpose |
|---|---|---|---|
| `Canvas<'_>` | Body | `craft_ui_canvas::canvas` | A canvas: a pasteboard the caller's canvas controls and the active tool share |
| `CropOverlay<'_>` | Leaf | `craft_ui_canvas::canvas::crop` | The crop frame of a document, edited by dragging it as Photoshop's Classic crop does (or moving and turning the image behind it in image mode) and by the keyboard |
| `FullWindowDialog<'_>` | Body | `craft_ui_canvas::canvas::full_window` | A dialog that fills the window: a title row, a body that takes the room between the header and the footer, and an optional footer |
| `FullWindowCanvas<'_>` | Pattern | `craft_ui_canvas::canvas::full_window_parts::canvas` | The canvas region of a full-window dialog: the app's image, its overlays and one tool, filling what the other regions left |
| `FullWindowSide` | Body | `craft_ui_canvas::canvas::full_window_parts::side` | A side column of a full-window dialog: Liquify's and Select and Mask's Properties, Content-Aware Fill's Preview and settings panels, Filter Gallery's settings |
| `FullWindowStatus` | Pattern | `craft_ui_canvas::canvas::full_window_parts::status` | The status of a preview over a [`Pending`]: nothing while it is ready, a progress bar (with the polite label "Updating preview") while it loads, a notice with the error while it failed and a notice that the preview is unavailable when its job ended without delivering |
| `FullWindowTitle` | Pattern | `craft_ui_canvas::canvas::full_window_parts::title` | The title strip's text: the workspace's name, then in brackets what it works on and the zoom on screen, "Liquify (Layer 1, 66.67%)" |
| `FullWindowZoomBar<'_>` | Pattern | `craft_ui_canvas::canvas::full_window_parts::zoom_bar` | The strip under a full-window canvas: Zoom Out, Zoom In, a zoom select, then a progress bar while the preview renders, or a note |
| `Navigator<'_>` | Leaf | `craft_ui_canvas::canvas::navigator::preview` | The preview box of the Navigator panel with the proxy rectangle of the view |
| `NavigatorZoomRow<'_>` | Pattern | `craft_ui_canvas::canvas::navigator::zoom_row` | The Navigator's zoom row: a percent field, Zoom Out, a slider over the whole zoom range and Zoom In, in reading order |
| `NavigatorPanel<'_>` | Pattern | `craft_ui_canvas::canvas::navigator_panel` | The Navigator panel (Photoshop's Window, Navigator): the [`Navigator`] preview box over the [`NavigatorZoomRow`], both bound to one view |
| `Pasteboard<'_>` | Leaf | `craft_ui_canvas::canvas::pasteboard` | The pasteboard and page frames under a document |
| `RasterDisplay<'_>` | Leaf | `craft_ui_canvas::canvas::raster` | The document display of one canvas: the document drawn through the view of the [`Canvas`](super::Canvas) it is shown in, at the canvas rect |
| `RotateView<'_>` | Leaf | `craft_ui_canvas::canvas::rotate` | The compass of a turned view: a dial whose needle points where the document's up lies on screen |
| `Rulers<'_>` | Leaf | `craft_ui_canvas::canvas::rulers` | The rulers of a canvas: ticks and labels counted from a zero point, level whatever the view's rotation, a pointer marker, the guide drag-out and the zero point's corner |
| `CanvasScrollbars<'_>` | Leaf | `craft_ui_canvas::canvas::scrollbars` | The scroll bars of a canvas |
| `SplitViews<'_>` | Body | `craft_ui_canvas::canvas::split` | One canvas area divided into 1, 2 or 4 panes |
| `TipCell` | Leaf | `craft_ui_canvas::canvas_controls::brush::cursor` | An aliased tip's whole-pixel cell on the pixel grid, outlined as a square or a disc: what a pencil shows under the hidden pointer |
| `FalloffPreview<'_>` | Leaf | `craft_ui_canvas::canvas_controls::brush::falloff` | A tip's falloff centred at a document point, with the circle of the brush's size round it: the preview a brush resize and a hover show |
| `CanvasGrid` | Leaf | `craft_ui_canvas::canvas_controls::grid` | Major and minor grid lines over a document, counted from `origin` |
| `Guides<'_>` | Leaf | `craft_ui_canvas::canvas_controls::guides` | The ruler guides of a canvas: drawn, taken by the pointer and moved with the keyboard |
| `StraightLinePreview` | Leaf | `craft_ui_canvas::canvas_controls::line_preview` | The Shift-click line from `from` (the end of the last stroke) to `to` (the pointer), both in document units |
| `Marquee` | Leaf | `craft_ui_canvas::canvas_controls::marquee` | An outline over the document, shown at the canvas's rect with `show_at` and mapped through the canvas's view |
| `HoverOutline` | Leaf | `craft_ui_canvas::canvas_controls::outline` | The outline of the object under the pointer: decoration over the canvas, drawn after the document and before the tool's own marks |
| `SelectionOutline<'_>` | Leaf | `craft_ui_canvas::canvas_controls::outline` | Highlights over the selected shapes, in the host's colour (a layer's colour), else the overlay line colour |
| `PixelGrid<'_>` | Leaf | `craft_ui_canvas::canvas_controls::pixel_grid` | The pixel grid over a raster document |
| `SmartGuides<'_>` | Leaf | `craft_ui_canvas::canvas_controls::smart_guides` | The alignment lines and distances an app shows while something moves (Smart Guides and Alt distances) |
| `HeaderText` | Leaf | `craft_ui_contract::contract::items::header` | A header cell's label |
| `LabelLeaf` | Leaf | `craft_ui_contract::contract::label::leaf` | The side label as a leaf: its own node, press state and reset dot |
| `TipText<'_>` | Leaf | `craft_ui_contract::contract::tooltip` | The text of a tooltip, on a popup surface |
| `Alert<'_>` | Pattern | `craft_ui_panels::dialog::alert` | A modal notice with one OK button: a prompt whose only answer is OK, which OK, Enter, Escape and the close action all give |
| `BlockingOverlay<'_>` | Body | `craft_ui_panels::dialog::blocking` | A modal layer that takes the window's input while it is shown, with the wait cursor |
| `DialogFrame<'_>` | Body | `craft_ui_panels::dialog::frame` | The look of a dialog in the flow of its parent: the dialog surface, a title row, the body and a footer |
| `Dialog<'_>` | Body | `craft_ui_panels::dialog::modal` | A dialog on its own layer |
| `ModalDragStrip` | Body | `craft_ui_panels::dialog::modal` | The chrome a modal dialog puts over a drag area of the window it covers, so that the window still moves by it |
| `Prompt<'_>` | Pattern | `craft_ui_panels::dialog::prompt` | A question with answers: a dialog on the modal preset, centred and not movable, with a message, optional extras and one footer button per answer |
| `StandardPrompt` | Pattern | `craft_ui_panels::dialog::prompts` | A standard confirmation on the dialog host: a prompt with the platform's button order, a letter on every answer and, with `dont_show_again`, a check box under the message |
| `RecoveryDialog` | Dialog | `craft_ui_panels::dialog::recovery` | Recover Unsaved Work, one document at a time: a prompt saying when the document was autosaved, with Discard and Recover (the accepting answer) |
| `UnsavedChangesDialog` | Pattern | `craft_ui_panels::dialog::unsaved` | The question for one modified document: a prompt titled "Unsaved changes" with the document's name in the message, Save (the accepting answer), Don't Save and Cancel in the platform's order and words, and, while the guard has more documents, an "Apply to All" check box |
| `SplitArea<'_, usize>` | Body | `craft_ui_panels::docking` | The docked tree of a layout, with a handle between neighbouring groups |
| `DockColumn<'_, u8>` | Body | `craft_ui_panels::docking::dock_column` | One column of a side dock: the column bar over the stacked groups of `column` |
| `FloatingGroup<'_>` | Body | `craft_ui_panels::docking::floating` | A floating dock group: a titled window the user moves by its title, resizes by its edges and corners, and minimizes by a double click on the title |
| `Flyout` | Pattern | `craft_ui_panels::docking::flyout` | A popup beside an iconic column, on the side of the canvas, level with the icon that opened it |
| `DockGroup<'_, usize>` | Body | `craft_ui_panels::docking::group` | A group of panels: a header of tab strip and panel menu button, dragged by its empty part, over the active panel's body |
| `GroupGrip<usize>` | Leaf | `craft_ui_panels::docking::group` | The handle a group is dragged by: an unmarked band over the empty room of the group's header |
| `IconicColumn<'_, u8>` | Body | `craft_ui_panels::docking::iconic` | A column collapsed to icons: the column bar over icon groups, one cell per panel |
| `DockRoot<'_, ()>` | Body | `craft_ui_panels::docking::root` | The room of a docking pattern: it fills the room offered, resolves the docking sizes its body reads, and takes the drops released on it |
| `Splitter` | Leaf | `craft_ui_panels::docking::splitter` | A line between two panes, as thick across as the pointer's grab distance |
| `StackSections` | Body | `craft_ui_panels::docking::stack` | An accordion laid out in the rect it is shown at (`section_heights` with the strip height of the docking sizes), with a divider between its open sections |
| `WindowMenuRows<'_, u32>` | Pattern | `craft_ui_panels::docking::window_menu` | One check row per panel in the order the app gives, for a Window menu |
| `ToolbarDrawer<'_, u8>` | Pattern | `craft_ui_panels::rails::drawer` | The All Tools drawer: a popover beside the rail with one list over all groups, a heading row for each group |
| `FlyoutButton<'_, u8>` | Leaf | `craft_ui_panels::rails::flyout` | One rail button that may stand for a group of tools |
| `PanelRail<'_, u8>` | Body | `craft_ui_panels::rails::panel_rail` | The rail of icons that open panels, as a side panel at one edge of the window, with a rule along the edge that faces the canvas (the inner edge of its pane) |
| `ToolRail<'_, u8>` | Body | `craft_ui_panels::rails::tool` | The rail of tool slots, as a side panel at one edge of the window: one `FlyoutButton` per visible slot showing the slot's shown tool, the slot with the current tool toggled on |
| `DropAction<u8>` | Body | `craft_ui_panels::sections::footer` | A container that is as large as its one child and takes drops of payload type `P` over that child |
| `FooterBar` | Body | `craft_ui_panels::sections::footer` | A footer region's content: its body is the caller's closure, and each member is its own Tab stop, in display order |
| `GroupBox<'_>` | Body | `craft_ui_panels::sections::group_box` | A frame around a body, titled by the container's label |
| `Panel<'_>` | Body | `craft_ui_panels::sections::panel` | A panel of a workspace: scrolling body, optional footer, optional title row |
| `ReorderableSections<'_>` | Pattern | `craft_ui_panels::sections::reorderable` | Sidebar sections the user folds, hides, pins and reorders, over the host's [`SectionLayout`] |
| `Section<'_>` | Body | `craft_ui_panels::sections::section` | An inline section of a panel that fills the width offered: a rule over a section-strength title row over a body |
| `SectionStack<'_, u8>` | Body | `craft_ui_panels::sections::stack` | Sections in the order of `order`, each shown by the caller's closure as a `Section::in_stack` |
| `TitleRow<'_>` | Leaf | `craft_ui_panels::sections::title_row` | An optional icon, a title with an optional note run on after it ("· note", muted body text) and an optional subtitle at the band's end (muted caption text: the target's kind), a lead (a disclosure bound to the container's open state, or a check box bound to its gate) and action parts |
| `DockArea<'_, usize>` | Pattern | `craft_ui_patterns::patterns::dock::area` | The docking pattern over a workspace |
| `PaneArea<'_, u32>` | Pattern | `craft_ui_patterns::patterns::dock::panes` | The app's side panes, bottom panes and floating panes around its document |
| `PaneFrame<'_>` | Body | `craft_ui_patterns::patterns::dock::panes` | A docked pane: a shell pane on one edge of the area, with a title row and a scrolling body |
| `WorkspaceSwitcher<'_, u32>` | Pattern | `craft_ui_patterns::patterns::dock::switcher` | The switcher at the end of an options bar: a small select showing the current workspace's name |
| `DeleteWorkspaceDialog<'_, u32>` | Pattern | `craft_ui_patterns::patterns::dock::workspace_dialogs` | Window › Workspace › Delete Workspace…: one of the saved workspaces |
| `NewWorkspaceDialog<'_, u32>` | Pattern | `craft_ui_patterns::patterns::dock::workspace_dialogs` | Window › Workspace › New Workspace…: a name for the live layout and the Capture boxes (Keyboard Shortcuts, Menus, Toolbar) |
| `AboutDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::about` | Help > About: tabs About, Contributors and Models over the app's [`AboutInfo`] and [`Credits`], with an OK button |
| `ParamDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::dialog` | A dialog from a parameter list: one row per [`Param`], the Preview check box with a preview pane when the host gives a picture, and OK, Cancel and a footer extra |
| `ExportAsDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::export::as_dialog` | File, Export, Export As: format, size, quality, metadata, colour profile, a preview and a size estimate the app computes |
| `FormatOptionsDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::export::options` | The options dialog of one export format: JPEG (the quality as a field, a slider and a preset list, then the encoding), layered TIFF (keep or discard the layers, and not to ask again), Targa (24 or 32 bits per pixel) or DDS (compression and mipmaps) |
| `OutputPathRow<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::export::path_row` | "Output To", a list of name templates (`[Comp Name].[fileExtension]`) and the resulting file name as a link, for render queues and export dialogs (After Effects' Render Queue) |
| `FormDialog<'_, bool>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::form` | A dialog over one value `V` |
| `GuideLayoutDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::guides` | New Guide Layout, Photoshop's dialog: Preset and Target lists, Color, the Columns and Rows groups (each a check box with Number, Width or Height, and Gutter), the Margin group (a check box and Top, Left, Bottom, Right), Center Columns and Clear Existing Guides; beside them a column of OK and Cancel with Preview under it |
| `NewGuideDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::guides::new_guide` | New Guide, and Edit Selected Guides when it edits a guide: an orientation, a position with a unit and a colour |
| `ListManager<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::list_manager` | A named list with a name box and a column of action buttons (after Excel's Macros dialog) |
| `NavigatorOptionsDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::navigator_options` | Panel Options of the Navigator: the colour of the proxy rectangle |
| `NewDocumentDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::new_document` | File > New: category tabs over a grid of preset cards, a details column and Create and Close |
| `PasswordDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::password` | A question with a lock icon, the message, the masked field and the buttons |
| `PathRow<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::path_row` | A text field with the path, taking the row's room, and a Browse button after it, for a row whose enclosing `Field` shows the label |
| `PdfExportDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::pdf_export` | File > Save as PDF: a preset row, Standard and Compatibility, and a list of sections (General, Compression, Marks and Bleeds, Output, Advanced, Security and Summary) beside the shown section |
| `PreviewPane<'_>` | Leaf | `craft_ui_patterns::patterns::form_dialogs::preview` | A picture in a well, over a checkerboard where it is transparent |
| `PreviewZoom` | Pattern | `craft_ui_patterns::patterns::form_dialogs::preview` | The zoom row of a preview: a zoom-out button, the zoom as a percentage field and a zoom-in button |
| `PropertiesDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::properties` | A properties dialog: a `TabStrip` over the tabs (none with one tab) and the rows of the shown tab as one `ParamRows` over the values of all of them |
| `ReportDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::report` | A report: the title, one summary line, the count of notes, the notes with their tone icons and, in the footer, Copy and OK |
| `ParamRows<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::rows` | The rows of a parameter list: a group of one labelled field per visible [`Param`], the control chosen by its [`ParamKind`], in a panel the host lays out or inside a dialog |
| `SaveForWebDialog<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::save_for_web` | The Save for Web dialog: the view tabs over a row of preview panes that share one view, the zoom row, the animation row, and the settings column |
| `CanvasSize<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::sizing::canvas` | Canvas Size: the current size, the new width and height with a unit each (no chain: the sides are independent), the Relative box, the 3 by 3 anchor and the colour that fills a larger canvas |
| `ImageSize<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::sizing::image` | Image Size: the width, height and resolution with a unit each, the chain that keeps the proportions, Resample with its method list and Scale Styles, over a readout of the file size and the dimensions |
| `Watermark<'_>` | Pattern | `craft_ui_patterns::patterns::form_dialogs::watermark` | The watermark rows of an export dialog: Style (Text, Graphic), the text field or the image path with Choose…, Orientation, Position as the 3 by 3 reference point, Rotation, Size, Opacity, Inset X and Y, and Shadow |
| `Inspector<'_>` | Pattern | `craft_ui_patterns::patterns::panels::inspector` | A properties panel: a `Panel` whose header names the target (icon and name, and the kind at the end), and whose body the caller fills with the target's controls, labelled as inspector rows (`LabelScheme::Inspector`) |
| `CommandPalette<'_>` | Pattern | `craft_ui_patterns::patterns::panels::palette` | A search over the app's commands in a centred modal box: a search field over the matching commands |
| `Tour<'_>` | Pattern | `craft_ui_patterns::patterns::panels::tour` | A guided tour of the interface: a card with the step count and a close button, the step's heading and text, Skip, Back and Next (Done on the last step), beside the part the step points at, which a pulsing ring marks |
| `PreferencesWindow<'_>` | Pattern | `craft_ui_patterns::patterns::preferences::window` | The preferences window: a search field over a page list and the shown page, with OK, Cancel and Apply under them |
| `PresetBrowser<'_, u32>` | Pattern | `craft_ui_patterns::patterns::presets::browser` | A library of named presets shown as thumbnails |
| `PresetFooter<'_, u32>` | Pattern | `craft_ui_patterns::patterns::presets::footer` | The footer of a preset panel: the host's own controls, the thumbnail size slider and the count, then the action buttons Delete, New and New Group and the host's own actions |
| `NamedPresetRow<'_, u32>` | Pattern | `craft_ui_patterns::patterns::presets::named` | A preset picker with the commands that make, rename and delete presets |
| `PresetPicker<'_, u32>` | Leaf | `craft_ui_patterns::patterns::presets::picker` | A field that shows the current preset and opens its presets |
| `AppShell<'_, ()>` | Pattern | `craft_ui_shell::shell::app_shell` | The window skeleton |
| `ShellRegion` | Body | `craft_ui_shell::shell::app_shell` | A region of the window skeleton: the root window's content, the scope that carries the shell to its slots, or one pane (a bar, a rail or the body) |
| `CanvasPanel<'_>` | Pattern | `craft_ui_shell::shell::canvas_shell` | The canvas panel of a dock: the panel rail at the end edge, spanning the tabs and the document; then, in what is left, the document tab strip flush against the document; then the document area, which the shell's backdrop shows through |
| `CaptionButton<'_>` | Leaf | `craft_ui_shell::shell::caption_button` | One caption button of a title bar |
| `DocumentWindow<'_>` | Body | `craft_ui_shell::shell::document_window` | A document's window: the container of one entry of the app's window list, in its own OS window |
| `StartScreen<'_>` | Pattern | `craft_ui_shell::shell::start` | The start screen, shown in a shell's body when no document is open |
| `TitleBar<'_>` | Body | `craft_ui_shell::shell::title_bar::bar` | The bar of a window whose frame the app draws |
| `ViewportWindow` | Pattern | `craft_ui_shell::shell::viewport_window` | A window of the app with a body the app fills |
| `AlignBar` | Pattern | `craft_ui_widgets::bars::align` | The align buttons, the optional distribute buttons and the menu button, shown as children of a `Bar` |
| `Bar<'_>` | Body | `craft_ui_widgets::bars::bar` | A bar over a chrome surface whose body holds the members in reading order: a tool bar's at the standard control size, an options or status bar's at the small one |
| `BreadcrumbBar<'_, u8>` | Leaf | `craft_ui_widgets::bars::breadcrumb` | A path of crumbs, the root first |
| `ConstraintFields<'_>` | Pattern | `craft_ui_widgets::bars::constraint_fields` | The Style, Width, swap and Height cells of an options `Bar` that read and write a marquee's [`Constraint`] (Photoshop's Rectangular Marquee bar, the Slice tool's) |
| `BarItems` | Leaf | `craft_ui_widgets::bars::items` | A strip of command items |
| `BarHome<'_>` | Pattern | `craft_ui_widgets::bars::lead` | The Home button at the start of an options bar: a toggle with the home icon, then a rule |
| `BarTool` | Pattern | `craft_ui_widgets::bars::lead` | The active tool's icon at the start of an options bar, after Home: the icon, the dropdown arrow that tells it has a menu, then a rule |
| `StatusMessage` | Pattern | `craft_ui_widgets::bars::status` | A message for the status bar and its tone |
| `StatusProgress` | Pattern | `craft_ui_widgets::bars::status` | A background task's progress, for a status bar's trailing group: the task's name, a progress bar that moves a segment while the extent is unknown, the percentage and an optional cancel button |
| `StatusReadout<'_>` | Pattern | `craft_ui_widgets::bars::status_readout` | The zoom field, the chosen item's text and the menu that chooses it, shown as children of a status `Bar` |
| `Button<'_>` | Leaf | `craft_ui_widgets::buttons::button` | A push button |
| `IconButton<'_>` | Leaf | `craft_ui_widgets::buttons::icon_button` | A square button showing only an icon |
| `Link` | Leaf | `craft_ui_widgets::buttons::link` | A link: drawn in the accent colour in a type role (body by default) and underlined, so colour is not its only cue |
| `SplitButton<'_, u8>` | Leaf | `craft_ui_widgets::buttons::split_button` | A button whose end opens a menu |
| `ToggleButton<'_>` | Leaf | `craft_ui_widgets::buttons::toggle_button` | A secondary-looking button that stays pressed while on: it takes the accent fill and edge, and its raised surface draws pressed in |
| `Checkbox<'_>` | Leaf | `craft_ui_widgets::choice::check` | A check box over a bool; a `Mixed` binding shows the mixed state and a click makes it checked |
| `Radio<u8>` | Leaf | `craft_ui_widgets::choice::radio` | A member of a `RadioGroup`: selected when the group's pick is its value |
| `RadioGroup<'_, u8>` | Body | `craft_ui_widgets::choice::radio` | A group of radio buttons over one value: one Tab stop, arrows move focus, Space, Enter or a click selects |
| `Rating<'_>` | Leaf | `craft_ui_widgets::choice::rating` | A rating over a `u8` from 0 (unrated) to `max` |
| `Segment` | Leaf | `craft_ui_widgets::choice::segmented` | What a segment of a `Segmented` shows: a label, or an icon with the label as its tooltip and name |
| `Segmented<'_, u8>` | Leaf | `craft_ui_widgets::choice::segmented` | A row of segments over one value |
| `Swatch<u8>` | Leaf | `craft_ui_widgets::choice::swatch` | A colour well that shows a colour from data and reports its activation; it edits nothing |
| `Switch<'_>` | Leaf | `craft_ui_widgets::choice::switch` | A switch over a bool; a `Mixed` binding rests the thumb in the middle and a click turns it on |
| `Disclosure<'_>` | Leaf | `craft_ui_widgets::controls::disclosure` | A button bound to an open state, with the expanded state |
| `Badge` | Leaf | `craft_ui_widgets::display::badge` | A small label in a tone: a soft tint by default, a solid fill with a solid variant, an edge without fill with the secondary variant (a chip) |
| `CanvasScrollbars` | Leaf | `craft_ui_canvas::canvas::scrollbars` | The scroll bars of a canvas |
| `CropOverlay` | Leaf | `craft_ui_canvas::canvas::crop` | The crop frame of a document, edited by dragging it as Photoshop's Classic crop does (or moving and turning the image behind it in image mode) and by the keyboard |
| `Divider` | Leaf | `craft_ui_widgets::display::divider` | A separator line in the divider colour, snapped to the pixel grid |
| `Icon<'_>` | Leaf | `craft_ui_widgets::display::icon` | An icon |
| `FalloffPreview` | Leaf | `craft_ui_canvas::canvas_controls::brush::falloff` | A tip's falloff centred at a document point, with the circle of the brush's size round it: the preview a brush resize and a hover show |
| `Guides` | Leaf | `craft_ui_canvas::canvas_controls::guides` | The ruler guides of a canvas: drawn, taken by the pointer and moved with the keyboard |
| `HeaderText` | Leaf | `craft_ui_contract::contract::items::header` | A header cell's label |
| `HoverOutline` | Leaf | `craft_ui_canvas::canvas_controls::outline` | The outline of the object under the pointer: decoration over the canvas, drawn after the document and before the tool's own marks |
| `Icon` | Leaf | `craft_ui_widgets::display::icon` | An icon |
| `InspectOverlay` | Leaf | `craft_ui_widgets::display::inspect_overlay` | The inspector's drawing over an inspected region, shown at the region's rect with `show_at` |
| `Kbd` | Leaf | `craft_ui_widgets::display::kbd` | A key chord |
| `Picture<'_>` | Leaf | `craft_ui_widgets::display::picture` | A picture of an image the caller makes |
| `Progress` | Leaf | `craft_ui_widgets::display::progress` | A progress bar |
| `Spinner` | Leaf | `craft_ui_widgets::display::spinner` | The busy mark |
| `TargetMark` | Body | `craft_ui_widgets::display::target_mark` | A ring around `target` that pulses in the accent colour, still where motion is off |
| `LabelLeaf` | Leaf | `craft_ui_contract::contract::label::leaf` | The side label as a leaf: its own node, press state and reset dot |
| `Marquee` | Leaf | `craft_ui_canvas::canvas_controls::marquee` | An outline over the document, shown at the canvas's rect with `show_at` and mapped through the canvas's view |
| `Navigator` | Leaf | `craft_ui_canvas::canvas::navigator::preview` | The preview box of the Navigator panel with the proxy rectangle of the view |
| `Pasteboard` | Leaf | `craft_ui_canvas::canvas::pasteboard` | The pasteboard and page frames under a document |
| `Picture` | Leaf | `craft_ui_widgets::display::picture` | A picture of an image the caller makes |
| `PixelGrid` | Leaf | `craft_ui_canvas::canvas_controls::pixel_grid` | The pixel grid over a raster document |
| `RasterDisplay` | Leaf | `craft_ui_canvas::canvas::raster` | The document display of one canvas: the document drawn through the view of the [`Canvas`](super::Canvas) it is shown in, at the canvas rect |
| `RotateView` | Leaf | `craft_ui_canvas::canvas::rotate` | The compass of a turned view: a dial whose needle points where the document's up lies on screen |
| `Rulers` | Leaf | `craft_ui_canvas::canvas::rulers` | The rulers of a canvas: ticks and labels counted from a zero point, level whatever the view's rotation, a pointer marker, the guide drag-out and the zero point's corner |
| `SelectionOutline` | Leaf | `craft_ui_canvas::canvas_controls::outline` | Highlights over the selected shapes, in the host's colour (a layer's colour), else the overlay line colour |
| `SmartGuides` | Leaf | `craft_ui_canvas::canvas_controls::smart_guides` | The alignment lines and distances an app shows while something moves (Smart Guides and Alt distances) |
| `StraightLinePreview` | Leaf | `craft_ui_canvas::canvas_controls::line_preview` | The Shift-click line from `from` (the end of the last stroke) to `to` (the pointer), both in document units |
| `Text` | Leaf | `craft_ui_widgets::display::text` | Text in a type role (body by default) and a shade (normal by default), or in the colour of a tone |
| `Field` | Body | `craft_ui_widgets::form::field` | One control with a side label: beside it, above it, as a caption or after it (`Field::layout`) |
| `FieldGroup` | Body | `craft_ui_widgets::form::group` | A stack of `Field`s (and `LinkedFields`) named `label`, filling the width offered |
| `SliderField<'_>` | Leaf | `craft_ui_widgets::form::slider_field` | A caption and number field over a full-width slider, on one value |
| `NodeGraph<'_>` | Items | `craft_ui_widgets::graph` | A graph of nodes at stored positions, joined by wires |
| `Node<'_>` | Leaf | `craft_ui_widgets::graph::node` | A node of a kind: a title, ports, the kind's inline controls and its body paint |
| `TipCell` | Leaf | `craft_ui_canvas::canvas_controls::brush::cursor` | An aliased tip's whole-pixel cell on the pixel grid, outlined as a square or a disc: what a pencil shows under the hidden pointer |
| `TipText` | Leaf | `craft_ui_contract::contract::tooltip` | The text of a tooltip, on a popup surface |
| `Canvas` | Body | `craft_ui_canvas::canvas` | A canvas: a pasteboard the caller's canvas controls and the active tool share |
| `Grid` | Body | `craft_ui_widgets::layout_components` | Children row-major over a column list: a child in flow takes the next cell |
| `Row` | Body | `craft_ui_widgets::layout_components` | Children side by side |
| `Stack<'_>` | Body | `craft_ui_widgets::layout_components` | Children one under another |
| `EventList<'_>` | Items | `craft_ui_widgets::list::events` | The list of events: one selected event; an empty log says so |
| `FindingsList<'_>` | Items | `craft_ui_widgets::list::findings` | The list of findings: one selected finding, a click or Enter activates it (the app goes to what it is about), and an empty list says so |
| `FindingsSummary<'_>` | Leaf | `craft_ui_widgets::list::findings` | The line over a list of findings: a status dot that says whether there are errors, then the counts |
| `ListRow<'_>` | Leaf | `craft_ui_widgets::list::row` | One row of a list |
| `RowThumb<'_>` | Leaf | `craft_ui_widgets::list::row::thumb` | The picture of a row's thumbnail, painted by the host through the content painter, which is clipped to the thumbnail's rect |
| `UndoList<'_>` | Items | `craft_ui_widgets::list::undo` | The undo list: one Tab stop, arrows mark rows through the row, Enter or a click picks it |
| `List<'_, usize>` | Items | `craft_ui_widgets::list::view` | A list of rows: one Tab stop, the selection rules of the collection contract, type-ahead on the rows' text (off unless `type_ahead`, so tool keys keep working), rename in place, drag to reorder, and the request for the app's context menu |
| `MenuBar<'_>` | Leaf | `craft_ui_widgets::menu::bar` | A menu bar |
| `TitleFace` | Leaf | `craft_ui_widgets::menu::bar` | The face of a menu title: lit while its menu is open or the keyboard is on it, its mnemonic underlined while Alt is held or the bar has focus |
| `EditMenu` | Pattern | `craft_ui_widgets::menu::edit` | The edit rows of a text control: Undo and Redo, Cut, Copy, Paste and Delete, then Select All |
| `MenuItem<'_>` | Leaf | `craft_ui_widgets::menu::item` | A row of a menu: a label, an optional icon, a check or radio mark, shortcut text and a detail line under the label |
| `PanelMenu` | Pattern | `craft_ui_widgets::menu::panel` | The rows of one panel's menu: the host's rows, a separator, then the dock's rows |
| `Menu<'_>` | Body | `craft_ui_widgets::menu::popup` | A menu: a popup of [`MenuItem`]s and [`Divider`]s the arrow keys move through, one roving group |
| `NoticeCenter` | Pattern | `craft_ui_widgets::notices::center` | The app's way to post notices to a window |
| `Notice<'_>` | Leaf | `craft_ui_widgets::notices::notice` | A message in a tone |
| `SettingsNotices` | Pattern | `craft_ui_widgets::notices::settings` | The notices a `SettingsNoticeState` calls for, newest problem first: an error notice when saving keeps failing and a warning when stored settings were reset |
| `ToastStack` | Pattern | `craft_ui_widgets::notices::toasts` | The cards of a window's toast queue |
| `ComboBox<'_>` | Leaf | `craft_ui_widgets::pickers::combo_box` | A text field with a list of options |
| `DatePicker<'_>` | Leaf | `craft_ui_widgets::pickers::date` | A text field for a date with a calendar popover |
| `SplitViews` | Body | `craft_ui_canvas::canvas::split` | One canvas area divided into 1, 2 or 4 panes |
| `Stack` | Body | `craft_ui_widgets::layout_components` | Children one under another |
| `TargetMark` | Body | `craft_ui_widgets::display::target_mark` | A ring around `target` that pulses in the accent colour, still where motion is off |
### Controls
| Type | Shape | Module | Purpose |
|---|---|---|---|
| `AltTextField` | Leaf | `craft_ui_widgets::text::alt_text` | An alt text editor: a multi-line description box and a Mark as decorative check |
| `AngleDial` | Leaf | `craft_ui_widgets::value_drag::angle_dial` | An angle in degrees: a dial whose needle points where the pointer is |
| `Badge` | Leaf | `craft_ui_widgets::display::badge` | A small label in a tone: a soft tint by default, a solid fill with a solid variant, an edge without fill with the secondary variant (a chip) |
| `BreadcrumbBar` | Leaf | `craft_ui_widgets::bars::breadcrumb` | A path of crumbs, the root first |
| `Button` | Leaf | `craft_ui_widgets::buttons::button` | A push button |
| `Calendar` | Leaf | `craft_ui_widgets::pickers::date::calendar` | The page of a date picker's popover |
| `SelectFace<'_>` | Leaf | `craft_ui_widgets::pickers::face` | The closed box of a picker: `text` elided to the room left of a trailing chevron |
| `IconPicker<'_, u8>` | Pattern | `craft_ui_widgets::pickers::icon_picker` | A searchable grid of icons in named groups |
| `ReferencePoint<'_>` | Leaf | `craft_ui_widgets::pickers::reference_point` | The 3 by 3 picker of a box's nine points: the point a transform, a resize or a watermark works about |
| `Select<'_, u8>` | Leaf | `craft_ui_widgets::pickers::select` | A field that shows the picked entry and opens a listbox of all of them |
| `TreePicker<'_, u32>` | Leaf | `craft_ui_widgets::pickers::tree_picker` | A field that opens a tree of items and folders and sets the binding to the picked item's key |
| `UnitSelect<'_>` | Leaf | `craft_ui_widgets::pickers::unit_select` | A number field with a select of units after it |
| `Popover<'_>` | Body | `craft_ui_widgets::popover::anchored` | A non-modal popup that hangs from the control that opened it and holds the app's body (a colour picker, a stroke editor, a settings form) |
| `DropVeil` | Body | `craft_ui_widgets::popover::drop_veil` | A body that dims and shows `label` on a card while the OS drags files over the window, and reports the files dropped on the window |
| `VeilCard` | Leaf | `craft_ui_widgets::popover::drop_veil` | The card of a veil: a popup surface around the label's `Text`, as wide and high as the text with its padding |
| `PopupList<'_>` | Body | `craft_ui_widgets::popover::popup_list` | A list popup under a field the app owns (a combo, a history picker) |
| `MetadataTable<'_>` | Pattern | `craft_ui_widgets::table::metadata` | A key and value table in groups: a search field over the rows keeps the fields whose name or value matches the typed text, and a check column marks the keys the app shows as columns |
| `Table<'_, usize>` | Items | `craft_ui_widgets::table::view` | A table: one Tab stop, a header row over the columns, the selection rules of the collection contract, type-ahead on the rows' text (with `type_ahead`), rename in place, drag to reorder, and the requests for the app's row and header menus |
| `DocumentTabs<'_, usize>` | Pattern | `craft_ui_widgets::tabs::document` | The tab strip of one document group |
| `TabStrip<'_, usize>` | Items | `craft_ui_widgets::tabs::strip` | A strip of tabs: one Tab stop, arrows move the lead without showing its tab, a click, Space or Enter shows the tab, Enter and a double click activate, Cmd/Ctrl+] and [ (or a drag) move the tab later and earlier, Shift to the ends, the menu key asks for the tab's context menu |
| `Tab<'_>` | Leaf | `craft_ui_widgets::tabs::tab` | One tab of a strip |
| `AltTextField<'_>` | Leaf | `craft_ui_widgets::text::alt_text` | An alt text editor: a multi-line description box and a Mark as decorative check |
| `ChipField<'_>` | Leaf | `craft_ui_widgets::text::chips` | A field of removable chips and a draft text part |
| `LinkedFields<'_, 2>` | Leaf | `craft_ui_widgets::text::linked` | `N` number fields joined by a link toggle |
| `NumberField<'_>` | Leaf | `craft_ui_widgets::text::number` | A number field: a text part over [`NumberCodec`]; empty text is `None` |
| `Checkbox` | Leaf | `craft_ui_widgets::choice::check` | A check box over a bool; a `Mixed` binding shows the mixed state and a click makes it checked |
| `ChipField` | Leaf | `craft_ui_widgets::text::chips` | A field of removable chips and a draft text part |
| `ComboBox` | Leaf | `craft_ui_widgets::pickers::combo_box` | A text field with a list of options |
| `DatePicker` | Leaf | `craft_ui_widgets::pickers::date` | A text field for a date with a calendar popover |
| `Disclosure` | Leaf | `craft_ui_widgets::controls::disclosure` | A button bound to an open state, with the expanded state |
| `IconButton` | Leaf | `craft_ui_widgets::buttons::icon_button` | A square button showing only an icon |
| `Kbd` | Leaf | `craft_ui_widgets::display::kbd` | A key chord |
| `Link` | Leaf | `craft_ui_widgets::buttons::link` | A link: drawn in the accent colour in a type role (body by default) and underlined, so colour is not its only cue |
| `LinkedFields` | Leaf | `craft_ui_widgets::text::linked` | `N` number fields joined by a link toggle |
| `NumberField` | Leaf | `craft_ui_widgets::text::number` | A number field: a text part over [`NumberCodec`]; empty text is `None` |
| `PointPicker` | Leaf | `craft_ui_widgets::value_drag::point_picker` | A point `[x, y]` picked on a well: x grows to the right and y downwards, as image coordinates do, in either reading direction |
| `Progress` | Leaf | `craft_ui_widgets::display::progress` | A progress bar |
| `Radio` | Leaf | `craft_ui_widgets::choice::radio` | A member of a `RadioGroup`: selected when the group's pick is its value |
| `RangeSlider` | Leaf | `craft_ui_widgets::value_drag::range_slider` | A range slider over `range` |
| `Rating` | Leaf | `craft_ui_widgets::choice::rating` | A rating over a `u8` from 0 (unrated) to `max` |
| `ReferencePoint` | Leaf | `craft_ui_widgets::pickers::reference_point` | The 3 by 3 picker of a box's nine points: the point a transform, a resize or a watermark works about |
| `Segment` | Leaf | `craft_ui_widgets::choice::segmented` | What a segment of a `Segmented` shows: a label, or an icon with the label as its tooltip and name |
| `Segmented` | Leaf | `craft_ui_widgets::choice::segmented` | A row of segments over one value |
| `Select` | Leaf | `craft_ui_widgets::pickers::select` | A field that shows the picked entry and opens a listbox of all of them |
| `SelectableText` | Leaf | `craft_ui_widgets::text::selectable_text` | Read-only text the user focuses with a press to select and copy, which Tab passes over |
| `TextField<'_>` | Leaf | `craft_ui_widgets::text::text_field` | A text field over a codec: plain text by default |
| `TileGrid<'_, usize>` | Items | `craft_ui_widgets::tile_grid::grid` | A grid of tiles: one Tab stop, the selection rules of the collection contract, type-ahead on the tiles' names (with `type_ahead`), rename in place (F2, or a slow second click on the caption of the only selected tile), drag to reorder, files dropped from the OS, and the request for the app's context menu |
| `ThumbnailSlider<'_>` | Leaf | `craft_ui_widgets::tile_grid::slider` | The tile size slider: a small picture glyph button, a `Slider` over [`TileZoom::range`] and a large picture glyph button |
| `Tile<'_>` | Leaf | `craft_ui_widgets::tile_grid::tile` | One tile of a tile grid |
| `AngleDial<'_>` | Leaf | `craft_ui_widgets::value_drag::angle_dial` | An angle in degrees: a dial whose needle points where the pointer is |
| `PointPicker<'_>` | Leaf | `craft_ui_widgets::value_drag::point_picker` | A point `[x, y]` picked on a well: x grows to the right and y downwards, as image coordinates do, in either reading direction |
| `RangeSlider<'_>` | Leaf | `craft_ui_widgets::value_drag::range_slider` | A range slider over `range` |
| `Slider<'_>` | Leaf | `craft_ui_widgets::value_drag::slider` | A slider over `range` |
| `ThumbRow<'_, 4>` | Leaf | `craft_ui_widgets::value_drag::thumb_row` | Thumbs on one row, tip up, each a value of its own |
| `SelectFace` | Leaf | `craft_ui_widgets::pickers::face` | The closed box of a picker: `text` elided to the room left of a trailing chevron |
| `Slider` | Leaf | `craft_ui_widgets::value_drag::slider` | A slider over `range` |
| `Spinner` | Leaf | `craft_ui_widgets::display::spinner` | The busy mark |
| `SplitButton` | Leaf | `craft_ui_widgets::buttons::split_button` | A button whose end opens a menu |
| `Swatch` | Leaf | `craft_ui_widgets::choice::swatch` | A colour well that shows a colour from data and reports its activation; it edits nothing |
| `Switch` | Leaf | `craft_ui_widgets::choice::switch` | A switch over a bool; a `Mixed` binding rests the thumb in the middle and a click turns it on |
| `TextField` | Leaf | `craft_ui_widgets::text::text_field` | A text field over a codec: plain text by default |
| `ThumbRow` | Leaf | `craft_ui_widgets::value_drag::thumb_row` | Thumbs on one row, tip up, each a value of its own |
| `ToggleButton` | Leaf | `craft_ui_widgets::buttons::toggle_button` | A secondary-looking button that stays pressed while on: it takes the accent fill and edge, and its raised surface draws pressed in |
| `TreePicker` | Leaf | `craft_ui_widgets::pickers::tree_picker` | A field that opens a tree of items and folders and sets the binding to the picked item's key |
| `UnitSelect` | Leaf | `craft_ui_widgets::pickers::unit_select` | A number field with a select of units after it |
| `RadioGroup` | Body | `craft_ui_widgets::choice::radio` | A group of radio buttons over one value: one Tab stop, arrows move focus, Space, Enter or a click selects |
### Composites
| Type | Shape | Module | Purpose |
|---|---|---|---|
| `FindingsSummary` | Leaf | `craft_ui_widgets::list::findings` | The line over a list of findings: a status dot that says whether there are errors, then the counts |
| `ListRow` | Leaf | `craft_ui_widgets::list::row` | One row of a list |
| `MenuBar` | Leaf | `craft_ui_widgets::menu::bar` | A menu bar |
| `MenuItem` | Leaf | `craft_ui_widgets::menu::item` | A row of a menu: a label, an optional icon, a check or radio mark, shortcut text and a detail line under the label |
| `Node` | Leaf | `craft_ui_widgets::graph::node` | A node of a kind: a title, ports, the kind's inline controls and its body paint |
| `Notice` | Leaf | `craft_ui_widgets::notices::notice` | A message in a tone |
| `PresetPicker` | Leaf | `craft_ui_patterns::patterns::presets::picker` | A field that shows the current preset and opens its presets |
| `RowThumb` | Leaf | `craft_ui_widgets::list::row::thumb` | The picture of a row's thumbnail, painted by the host through the content painter, which is clipped to the thumbnail's rect |
| `SliderField` | Leaf | `craft_ui_widgets::form::slider_field` | A caption and number field over a full-width slider, on one value |
| `Tab` | Leaf | `craft_ui_widgets::tabs::tab` | One tab of a strip |
| `ThumbnailSlider` | Leaf | `craft_ui_widgets::tile_grid::slider` | The tile size slider: a small picture glyph button, a `Slider` over [`TileZoom::range`] and a large picture glyph button |
| `Tile` | Leaf | `craft_ui_widgets::tile_grid::tile` | One tile of a tile grid |
| `TitleFace` | Leaf | `craft_ui_widgets::menu::bar` | The face of a menu title: lit while its menu is open or the keyboard is on it, its mnemonic underlined while Alt is held or the bar has focus |
| `TitleRow` | Leaf | `craft_ui_panels::sections::title_row` | An optional icon, a title with an optional note run on after it ("· note", muted body text) and an optional subtitle at the band's end (muted caption text: the target's kind), a lead (a disclosure bound to the container's open state, or a check box bound to its gate) and action parts |
| `DropAction` | Body | `craft_ui_panels::sections::footer` | A container that is as large as its one child and takes drops of payload type `P` over that child |
| `Field` | Body | `craft_ui_widgets::form::field` | One control with a side label: beside it, above it, as a caption or after it (`Field::layout`) |
| `FieldGroup` | Body | `craft_ui_widgets::form::group` | A stack of `Field`s (and `LinkedFields`) named `label`, filling the width offered |
| `FooterBar` | Body | `craft_ui_panels::sections::footer` | A footer region's content: its body is the caller's closure, and each member is its own Tab stop, in display order |
| `GroupBox` | Body | `craft_ui_panels::sections::group_box` | A frame around a body, titled by the container's label |
| `Menu` | Body | `craft_ui_widgets::menu::popup` | A menu: a popup of [`MenuItem`]s and [`Divider`]s the arrow keys move through, one roving group |
| `Section` | Body | `craft_ui_panels::sections::section` | An inline section of a panel that fills the width offered: a rule over a section-strength title row over a body |
| `SectionStack` | Body | `craft_ui_panels::sections::stack` | Sections in the order of `order`, each shown by the caller's closure as a `Section::in_stack` |
| `EventList` | Items | `craft_ui_widgets::list::events` | The list of events: one selected event; an empty log says so |
| `FindingsList` | Items | `craft_ui_widgets::list::findings` | The list of findings: one selected finding, a click or Enter activates it (the app goes to what it is about), and an empty list says so |
| `List` | Items | `craft_ui_widgets::list::view` | A list of rows: one Tab stop, the selection rules of the collection contract, type-ahead on the rows' text (off unless `type_ahead`, so tool keys keep working), rename in place, drag to reorder, and the request for the app's context menu |
| `NodeGraph` | Items | `craft_ui_widgets::graph` | A graph of nodes at stored positions, joined by wires |
| `Table` | Items | `craft_ui_widgets::table::view` | A table: one Tab stop, a header row over the columns, the selection rules of the collection contract, type-ahead on the rows' text (with `type_ahead`), rename in place, drag to reorder, and the requests for the app's row and header menus |
| `TabStrip` | Items | `craft_ui_widgets::tabs::strip` | A strip of tabs: one Tab stop, arrows move the lead without showing its tab, a click, Space or Enter shows the tab, Enter and a double click activate, Cmd/Ctrl+] and [ (or a drag) move the tab later and earlier, Shift to the ends, the menu key asks for the tab's context menu |
| `TileGrid` | Items | `craft_ui_widgets::tile_grid::grid` | A grid of tiles: one Tab stop, the selection rules of the collection contract, type-ahead on the tiles' names (with `type_ahead`), rename in place (F2, or a slow second click on the caption of the only selected tile), drag to reorder, files dropped from the OS, and the request for the app's context menu |
| `UndoList` | Items | `craft_ui_widgets::list::undo` | The undo list: one Tab stop, arrows mark rows through the row, Enter or a click picks it |
### Patterns
| Type | Shape | Module | Purpose |
|---|---|---|---|
| `BarItems` | Leaf | `craft_ui_widgets::bars::items` | A strip of command items |
| `FlyoutButton` | Leaf | `craft_ui_panels::rails::flyout` | One rail button that may stand for a group of tools |
| `GroupGrip` | Leaf | `craft_ui_panels::docking::group` | The handle a group is dragged by: an unmarked band over the empty room of the group's header |
| `PreviewPane` | Leaf | `craft_ui_patterns::patterns::form_dialogs::preview` | A picture in a well, over a checkerboard where it is transparent |
| `Splitter` | Leaf | `craft_ui_panels::docking::splitter` | A line between two panes, as thick across as the pointer's grab distance |
| `VeilCard` | Leaf | `craft_ui_widgets::popover::drop_veil` | The card of a veil: a popup surface around the label's `Text`, as wide and high as the text with its padding |
| `Bar` | Body | `craft_ui_widgets::bars::bar` | A bar over a chrome surface whose body holds the members in reading order: a tool bar's at the standard control size, an options or status bar's at the small one |
| `BlockingOverlay` | Body | `craft_ui_panels::dialog::blocking` | A modal layer that takes the window's input while it is shown, with the wait cursor |
| `Dialog` | Body | `craft_ui_panels::dialog::modal` | A dialog on its own layer |
| `DialogFrame` | Body | `craft_ui_panels::dialog::frame` | The look of a dialog in the flow of its parent: the dialog surface, a title row, the body and a footer |
| `DockColumn` | Body | `craft_ui_panels::docking::dock_column` | One column of a side dock: the column bar over the stacked groups of `column` |
| `DockGroup` | Body | `craft_ui_panels::docking::group` | A group of panels: a header of tab strip and panel menu button, dragged by its empty part, over the active panel's body |
| `DockRoot` | Body | `craft_ui_panels::docking::root` | The room of a docking pattern: it fills the room offered, resolves the docking sizes its body reads, and takes the drops released on it |
| `DropVeil` | Body | `craft_ui_widgets::popover::drop_veil` | A body that dims and shows `label` on a card while the OS drags files over the window, and reports the files dropped on the window |
| `FloatingGroup` | Body | `craft_ui_panels::docking::floating` | A floating dock group: a titled window the user moves by its title, resizes by its edges and corners, and minimizes by a double click on the title |
| `FullWindowDialog` | Body | `craft_ui_canvas::canvas::full_window` | A dialog that fills the window: a title row, a body that takes the room between the header and the footer, and an optional footer |
| `FullWindowSide` | Body | `craft_ui_canvas::canvas::full_window_parts::side` | A side column of a full-window dialog: Liquify's and Select and Mask's Properties, Content-Aware Fill's Preview and settings panels, Filter Gallery's settings |
| `IconicColumn` | Body | `craft_ui_panels::docking::iconic` | A column collapsed to icons: the column bar over icon groups, one cell per panel |
| `ModalDragStrip` | Body | `craft_ui_panels::dialog::modal` | The chrome a modal dialog puts over a drag area of the window it covers, so that the window still moves by it |
| `PaneFrame` | Body | `craft_ui_patterns::patterns::dock::panes` | A docked pane: a shell pane on one edge of the area, with a title row and a scrolling body |
| `Panel` | Body | `craft_ui_panels::sections::panel` | A panel of a workspace: scrolling body, optional footer, optional title row |
| `PanelRail` | Body | `craft_ui_panels::rails::panel_rail` | The rail of icons that open panels, as a side panel at one edge of the window, with a rule along the edge that faces the canvas (the inner edge of its pane) |
| `Popover` | Body | `craft_ui_widgets::popover::anchored` | A non-modal popup that hangs from the control that opened it and holds the app's body (a colour picker, a stroke editor, a settings form) |
| `PopupList` | Body | `craft_ui_widgets::popover::popup_list` | A list popup under a field the app owns (a combo, a history picker) |
| `SplitArea` | Body | `craft_ui_panels::docking` | The docked tree of a layout, with a handle between neighbouring groups |
| `StackSections` | Body | `craft_ui_panels::docking::stack` | An accordion laid out in the rect it is shown at (`section_heights` with the strip height of the docking sizes), with a divider between its open sections |
| `TitleBar` | Body | `craft_ui_shell::shell::title_bar::bar` | The bar of a window whose frame the app draws |
| `ToolRail` | Body | `craft_ui_panels::rails::tool` | The rail of tool slots, as a side panel at one edge of the window: one `FlyoutButton` per visible slot showing the slot's shown tool, the slot with the current tool toggled on |
| `AboutDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::about` | Help > About: tabs About, Contributors and Models over the app's [`AboutInfo`] and [`Credits`], with an OK button |
| `Alert` | Pattern | `craft_ui_panels::dialog::alert` | A modal notice with one OK button: a prompt whose only answer is OK, which OK, Enter, Escape and the close action all give |
| `AlignBar` | Pattern | `craft_ui_widgets::bars::align` | The align buttons, the optional distribute buttons and the menu button, shown as children of a `Bar` |
| `BarHome` | Pattern | `craft_ui_widgets::bars::lead` | The Home button at the start of an options bar: a toggle with the home icon, then a rule |
| `BarTool` | Pattern | `craft_ui_widgets::bars::lead` | The active tool's icon at the start of an options bar, after Home: the icon, the dropdown arrow that tells it has a menu, then a rule |
| `CanvasSize` | Pattern | `craft_ui_patterns::patterns::form_dialogs::sizing::canvas` | Canvas Size: the current size, the new width and height with a unit each (no chain: the sides are independent), the Relative box, the 3 by 3 anchor and the colour that fills a larger canvas |
| `CommandPalette` | Pattern | `craft_ui_patterns::patterns::panels::palette` | A search over the app's commands in a centred modal box: a search field over the matching commands |
| `ConstraintFields` | Pattern | `craft_ui_widgets::bars::constraint_fields` | The Style, Width, swap and Height cells of an options `Bar` that read and write a marquee's [`Constraint`] (Photoshop's Rectangular Marquee bar, the Slice tool's) |
| `DeleteWorkspaceDialog` | Pattern | `craft_ui_patterns::patterns::dock::workspace_dialogs` | Window › Workspace › Delete Workspace…: one of the saved workspaces |
| `DockArea` | Pattern | `craft_ui_patterns::patterns::dock::area` | The docking pattern over a workspace |
| `DocumentTabs` | Pattern | `craft_ui_widgets::tabs::document` | The tab strip of one document group |
| `EditMenu` | Pattern | `craft_ui_widgets::menu::edit` | The edit rows of a text control: Undo and Redo, Cut, Copy, Paste and Delete, then Select All |
| `ExportAsDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::export::as_dialog` | File, Export, Export As: format, size, quality, metadata, colour profile, a preview and a size estimate the app computes |
| `Flyout` | Pattern | `craft_ui_panels::docking::flyout` | A popup beside an iconic column, on the side of the canvas, level with the icon that opened it |
| `FormatOptionsDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::export::options` | The options dialog of one export format: JPEG (the quality as a field, a slider and a preset list, then the encoding), layered TIFF (keep or discard the layers, and not to ask again), Targa (24 or 32 bits per pixel) or DDS (compression and mipmaps) |
| `FormDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::form` | A dialog over one value `V` |
| `FullWindowCanvas` | Pattern | `craft_ui_canvas::canvas::full_window_parts::canvas` | The canvas region of a full-window dialog: the app's image, its overlays and one tool, filling what the other regions left |
| `FullWindowStatus` | Pattern | `craft_ui_canvas::canvas::full_window_parts::status` | The status of a preview over a [`Pending`]: nothing while it is ready, a progress bar (with the polite label "Updating preview") while it loads, a notice with the error while it failed and a notice that the preview is unavailable when its job ended without delivering |
| `FullWindowTitle` | Pattern | `craft_ui_canvas::canvas::full_window_parts::title` | The title strip's text: the workspace's name, then in brackets what it works on and the zoom on screen, "Liquify (Layer 1, 66.67%)" |
| `FullWindowZoomBar` | Pattern | `craft_ui_canvas::canvas::full_window_parts::zoom_bar` | The strip under a full-window canvas: Zoom Out, Zoom In, a zoom select, then a progress bar while the preview renders, or a note |
| `GuideLayoutDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::guides` | New Guide Layout, Photoshop's dialog: Preset and Target lists, Color, the Columns and Rows groups (each a check box with Number, Width or Height, and Gutter), the Margin group (a check box and Top, Left, Bottom, Right), Center Columns and Clear Existing Guides; beside them a column of OK and Cancel with Preview under it |
| `IconPicker` | Pattern | `craft_ui_widgets::pickers::icon_picker` | A searchable grid of icons in named groups |
| `ImageSize` | Pattern | `craft_ui_patterns::patterns::form_dialogs::sizing::image` | Image Size: the width, height and resolution with a unit each, the chain that keeps the proportions, Resample with its method list and Scale Styles, over a readout of the file size and the dimensions |
| `Inspector` | Pattern | `craft_ui_patterns::patterns::panels::inspector` | A properties panel: a `Panel` whose header names the target (icon and name, and the kind at the end), and whose body the caller fills with the target's controls, labelled as inspector rows (`LabelScheme::Inspector`) |
| `ListManager` | Pattern | `craft_ui_patterns::patterns::form_dialogs::list_manager` | A named list with a name box and a column of action buttons (after Excel's Macros dialog) |
| `MetadataTable` | Pattern | `craft_ui_widgets::table::metadata` | A key and value table in groups: a search field over the rows keeps the fields whose name or value matches the typed text, and a check column marks the keys the app shows as columns |
| `NamedPresetRow` | Pattern | `craft_ui_patterns::patterns::presets::named` | A preset picker with the commands that make, rename and delete presets |
| `NavigatorOptionsDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::navigator_options` | Panel Options of the Navigator: the colour of the proxy rectangle |
| `NavigatorPanel` | Pattern | `craft_ui_canvas::canvas::navigator_panel` | The Navigator panel (Photoshop's Window, Navigator): the [`Navigator`] preview box over the [`NavigatorZoomRow`], both bound to one view |
| `NavigatorZoomRow` | Pattern | `craft_ui_canvas::canvas::navigator::zoom_row` | The Navigator's zoom row: a percent field, Zoom Out, a slider over the whole zoom range and Zoom In, in reading order |
| `NewDocumentDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::new_document` | File > New: category tabs over a grid of preset cards, a details column and Create and Close |
| `NewGuideDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::guides::new_guide` | New Guide, and Edit Selected Guides when it edits a guide: an orientation, a position with a unit and a colour |
| `NewWorkspaceDialog` | Pattern | `craft_ui_patterns::patterns::dock::workspace_dialogs` | Window › Workspace › New Workspace…: a name for the live layout and the Capture boxes (Keyboard Shortcuts, Menus, Toolbar) |
| `NoticeCenter` | Pattern | `craft_ui_widgets::notices::center` | The app's way to post notices to a window |
| `OutputPathRow` | Pattern | `craft_ui_patterns::patterns::form_dialogs::export::path_row` | "Output To", a list of name templates (`[Comp Name].[fileExtension]`) and the resulting file name as a link, for render queues and export dialogs (After Effects' Render Queue) |
| `PaneArea` | Pattern | `craft_ui_patterns::patterns::dock::panes` | The app's side panes, bottom panes and floating panes around its document |
| `PanelMenu` | Pattern | `craft_ui_widgets::menu::panel` | The rows of one panel's menu: the host's rows, a separator, then the dock's rows |
| `ParamDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::dialog` | A dialog from a parameter list: one row per [`Param`], the Preview check box with a preview pane when the host gives a picture, and OK, Cancel and a footer extra |
| `ParamRows` | Pattern | `craft_ui_patterns::patterns::form_dialogs::rows` | The rows of a parameter list: a group of one labelled field per visible [`Param`], the control chosen by its [`ParamKind`], in a panel the host lays out or inside a dialog |
| `PasswordDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::password` | A question with a lock icon, the message, the masked field and the buttons |
| `PathRow` | Pattern | `craft_ui_patterns::patterns::form_dialogs::path_row` | A text field with the path, taking the row's room, and a Browse button after it, for a row whose enclosing `Field` shows the label |
| `PdfExportDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::pdf_export` | File > Save as PDF: a preset row, Standard and Compatibility, and a list of sections (General, Compression, Marks and Bleeds, Output, Advanced, Security and Summary) beside the shown section |
| `PreferencesWindow` | Pattern | `craft_ui_patterns::patterns::preferences::window` | The preferences window: a search field over a page list and the shown page, with OK, Cancel and Apply under them |
| `PresetBrowser` | Pattern | `craft_ui_patterns::patterns::presets::browser` | A library of named presets shown as thumbnails |
| `PresetFooter` | Pattern | `craft_ui_patterns::patterns::presets::footer` | The footer of a preset panel: the host's own controls, the thumbnail size slider and the count, then the action buttons Delete, New and New Group and the host's own actions |
| `PreviewZoom` | Pattern | `craft_ui_patterns::patterns::form_dialogs::preview` | The zoom row of a preview: a zoom-out button, the zoom as a percentage field and a zoom-in button |
| `Prompt` | Pattern | `craft_ui_panels::dialog::prompt` | A question with answers: a dialog on the modal preset, centred and not movable, with a message, optional extras and one footer button per answer |
| `PropertiesDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::properties` | A properties dialog: a `TabStrip` over the tabs (none with one tab) and the rows of the shown tab as one `ParamRows` over the values of all of them |
| `ReorderableSections` | Pattern | `craft_ui_panels::sections::reorderable` | Sidebar sections the user folds, hides, pins and reorders, over the host's [`SectionLayout`] |
| `ReportDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::report` | A report: the title, one summary line, the count of notes, the notes with their tone icons and, in the footer, Copy and OK |
| `SaveForWebDialog` | Pattern | `craft_ui_patterns::patterns::form_dialogs::save_for_web` | The Save for Web dialog: the view tabs over a row of preview panes that share one view, the zoom row, the animation row, and the settings column |
| `SettingsNotices` | Pattern | `craft_ui_widgets::notices::settings` | The notices a `SettingsNoticeState` calls for, newest problem first: an error notice when saving keeps failing and a warning when stored settings were reset |
| `StandardPrompt` | Pattern | `craft_ui_panels::dialog::prompts` | A standard confirmation on the dialog host: a prompt with the platform's button order, a letter on every answer and, with `dont_show_again`, a check box under the message |
| `StatusMessage` | Pattern | `craft_ui_widgets::bars::status` | A message for the status bar and its tone |
| `StatusProgress` | Pattern | `craft_ui_widgets::bars::status` | A background task's progress, for a status bar's trailing group: the task's name, a progress bar that moves a segment while the extent is unknown, the percentage and an optional cancel button |
| `StatusReadout` | Pattern | `craft_ui_widgets::bars::status_readout` | The zoom field, the chosen item's text and the menu that chooses it, shown as children of a status `Bar` |
| `ToastStack` | Pattern | `craft_ui_widgets::notices::toasts` | The cards of a window's toast queue |
| `ToolbarDrawer` | Pattern | `craft_ui_panels::rails::drawer` | The All Tools drawer: a popover beside the rail with one list over all groups, a heading row for each group |
| `Tour` | Pattern | `craft_ui_patterns::patterns::panels::tour` | A guided tour of the interface: a card with the step count and a close button, the step's heading and text, Skip, Back and Next (Done on the last step), beside the part the step points at, which a pulsing ring marks |
| `UnsavedChangesDialog` | Pattern | `craft_ui_panels::dialog::unsaved` | The question for one modified document: a prompt titled "Unsaved changes" with the document's name in the message, Save (the accepting answer), Don't Save and Cancel in the platform's order and words, and, while the guard has more documents, an "Apply to All" check box |
| `Watermark` | Pattern | `craft_ui_patterns::patterns::form_dialogs::watermark` | The watermark rows of an export dialog: Style (Text, Graphic), the text field or the image path with Choose…, Orientation, Position as the 3 by 3 reference point, Rotation, Size, Opacity, Inset X and Y, and Shadow |
| `WindowMenuRows` | Pattern | `craft_ui_panels::docking::window_menu` | One check row per panel in the order the app gives, for a Window menu |
| `WorkspaceSwitcher` | Pattern | `craft_ui_patterns::patterns::dock::switcher` | The switcher at the end of an options bar: a small select showing the current workspace's name |
| `RecoveryDialog` | Dialog | `craft_ui_panels::dialog::recovery` | Recover Unsaved Work, one document at a time: a prompt saying when the document was autosaved, with Discard and Recover (the accepting answer) |
### Shells
| Type | Shape | Module | Purpose |
|---|---|---|---|
| `CaptionButton` | Leaf | `craft_ui_shell::shell::caption_button` | One caption button of a title bar |
| `DocumentWindow` | Body | `craft_ui_shell::shell::document_window` | A document's window: the container of one entry of the app's window list, in its own OS window |
| `ShellRegion` | Body | `craft_ui_shell::shell::app_shell` | A region of the window skeleton: the root window's content, the scope that carries the shell to its slots, or one pane (a bar, a rail or the body) |
| `AppShell` | Pattern | `craft_ui_shell::shell::app_shell` | The window skeleton |
| `CanvasPanel` | Pattern | `craft_ui_shell::shell::canvas_shell` | The canvas panel of a dock: the panel rail at the end edge, spanning the tabs and the document; then, in what is left, the document tab strip flush against the document; then the document area, which the shell's backdrop shows through |
| `StartScreen` | Pattern | `craft_ui_shell::shell::start` | The start screen, shown in a shell's body when no document is open |
| `ViewportWindow` | Pattern | `craft_ui_shell::shell::viewport_window` | A window of the app with a body the app fills |
## Behaviours