Expand description
General-purpose UI components built on top of fret-ui.
This crate is intentionally domain-agnostic (no engine/editor-specific concepts). Styling is token-driven and supports namespaced extension tokens (see ADR 0050).
Note: This crate is declarative-only. Retained-widget authoring is intentionally not part of the public component surface.
Re-exports§
pub use activate::on_activate;pub use activate::on_activate_notify;pub use activate::on_activate_request_redraw;pub use activate::on_activate_request_redraw_notify;pub use image_metadata::ImageMetadata;pub use image_metadata::ImageMetadataStore;pub use image_metadata::with_image_metadata_store_mut;pub use image_sampling::ImageSamplingExt;pub use ui_builder::IntoUiElement;pub use ui_builder::IntoUiElementInExt;pub use ui_builder::UiBuilder;pub use ui_builder::UiExt;pub use ui_builder::UiPatch;pub use ui_builder::UiPatchTarget;pub use ui_builder::UiSupportsChrome;pub use ui_builder::UiSupportsLayout;pub use overlay_controller::OverlayArbitrationSnapshot;pub use overlay_controller::OverlayController;pub use overlay_controller::OverlayKind;pub use overlay_controller::OverlayPresence;pub use overlay_controller::OverlayRequest;pub use overlay_controller::OverlayStackEntryKind;pub use overlay_controller::ToastLayerSpec;pub use overlay_controller::WindowOverlayStackEntry;pub use overlay_controller::WindowOverlayStackSnapshot;pub use tree::TreeEntry;pub use tree::TreeItem;pub use tree::TreeItemId;pub use tree::TreeRowRenderer;pub use tree::TreeRowState;pub use tree::TreeState;pub use tree::flatten_tree;
Modules§
- activate
- colors
- command
- custom_
effects - declarative
- headless
- image_
metadata - image_
sampling - node_
graph - Node-graph related policy helpers and token mappings.
- overlay
- overlay_
controller - prelude
- Common imports for component/app code using
fret-ui-kit. - primitives
- Radix-aligned primitive facades.
- recipes
- theme_
tokens - tooltip_
provider - tree
- typography
- ui
- ui_
builder - viewport_
tooling - Viewport tool arbitration helpers (Tier A embedding).
Macros§
- children
- Build a heterogeneous
Vec<AnyElement>without repetitive child landing boilerplate. - ui_
component_ chrome_ layout - Implement the
UiBuilderpatch + render glue for a component that supports both chrome and layout refinements. - ui_
component_ chrome_ layout_ patch_ only - Implement
UiPatchTarget+UiSupports*for a component that supports both chrome and layout refinements, without implementing rendering glue. - ui_
component_ layout_ only - Implement the
UiBuilderpatch + render glue for a component that supports layout refinements only. - ui_
component_ layout_ only_ patch_ only - Implement
UiPatchTarget+UiSupportsLayoutfor a component that supports layout refinements only, without implementing rendering glue. - ui_
component_ passthrough - Implement patch + render glue for a component that does not accept any
UiPatch, but still wants to opt into the.ui()surface (e.g. purely cosmetic elements). - ui_
component_ passthrough_ patch_ only - Implement
UiPatchTargetfor a component that does not accept anyUiPatch, without implementing rendering glue. - ui_
component_ render_ once - Implement internal landing glue for a stateless component authored as
RenderOnce(ADR 0039).
Structs§
- Chrome
Refinement - Control chrome style patches (colors, padding, borders, radius, etc).
- Corners4
- A 4-corner value (top-left/top-right/bottom-right/bottom-left) used for fluent authoring ergonomics.
- Edges4
- A 4-edge value (top/right/bottom/left) used for fluent authoring ergonomics.
- Layout
Refinement - Layout-affecting style patches (margin, positioning, size constraints, flex/grid).
- Padding
Refinement - Styled
- Toast
Action - Toast
Async Queue Handle - Thread-safe handle for scheduling toast upserts/dismissals from background work.
- Toast
Button Style - Toast
Icon Button Style - Toast
Icon Overrides - ToastId
- Toast
Layer Style - Toast
Offset - Sonner-style viewport offsets (
offset/mobileOffset). - Toast
Request - Toast
Store - Toast
Swipe Config - Toast
Swipe Directions - Sonner-style swipe direction allowlist (the
swipeDirectionstoaster prop). - Toast
Text Style - Toast
Variant Colors - Toast
Variant Palette - Widget
State Property - Widget
States
Enums§
- Color
Fallback - Color
Ref - Items
- Tailwind-like
items-*vocabulary (component-layer). - Justify
- Tailwind-like
justify-*vocabulary (component-layer). - Length
Refinement - Margin
Edge - Margin edges support
autoin addition to px/token lengths. - Metric
Ref - Overflow
Refinement - Tailwind-like overflow vocabulary (component-layer).
- Radius
- Tailwind-like border radius presets for component libraries.
- Shadow
Preset - Signed
Metric Ref - Size
- Component sizing vocabulary inspired by Tailwind/shadcn and gpui-component.
- Space
- Tailwind-like spacing scale for component libraries.
- Toast
Async Msg - Toast
Description - Toast
Duration - Toast
Icon Override - Toast
Position - Toast
Swipe Direction - Mirrors Radix toast
swipeDirection(left/right/up/down). - Toast
Variant - Widget
State
Constants§
- DEFAULT_
MAX_ TOASTS - DEFAULT_
TOAST_ DURATION - DEFAULT_
VISIBLE_ TOASTS - TOAST_
VIEWPORT_ FOCUS_ COMMAND - Radix
ToastViewportfocus-jump command (default hotkey:F8). - TOAST_
VIEWPORT_ RESTORE_ COMMAND - Restores focus after a
ToastViewportfocus jump (default hotkey:Escapewhile focused).
Traits§
- Refine
Style - Sizable
- Shared component API for size configuration.
- Stylable
- Styled
Ext
Functions§
- merge_
override_ slot - Right-biased merge for an optional override slot (ADR 0220).
- merge_
slot - Merges ADR 0220 slot overrides with shallow, right-biased precedence.
- resolve_
override_ slot - Resolves an ADR 0220-style override slot for a non-optional value.
- resolve_
override_ slot_ opt - Resolves an ADR 0220-style override slot for an optional value.
- resolve_
override_ slot_ opt_ with - Resolves an ADR 0220-style override slot for a computed optional default.
- resolve_
override_ slot_ with - Resolves an ADR 0220-style override slot for a computed default.
- resolve_
slot - Applies ADR 0220 “nullable per-state override” semantics for a single slot.
- toast_
async_ queue - try_
handle_ window_ overlays_ command - Attempts to handle a window-scoped command that targets
fret-ui-kitoverlay substrates.
Type Aliases§
- Override
Slot - ADR 0220 override slot shape.