Skip to main content

Crate fret_ui_kit

Crate fret_ui_kit 

Source
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 UiBuilder patch + 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 UiBuilder patch + render glue for a component that supports layout refinements only.
ui_component_layout_only_patch_only
Implement UiPatchTarget + UiSupportsLayout for 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 UiPatchTarget for a component that does not accept any UiPatch, without implementing rendering glue.
ui_component_render_once
Implement internal landing glue for a stateless component authored as RenderOnce (ADR 0039).

Structs§

ChromeRefinement
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.
LayoutRefinement
Layout-affecting style patches (margin, positioning, size constraints, flex/grid).
PaddingRefinement
Styled
ToastAction
ToastAsyncQueueHandle
Thread-safe handle for scheduling toast upserts/dismissals from background work.
ToastButtonStyle
ToastIconButtonStyle
ToastIconOverrides
ToastId
ToastLayerStyle
ToastOffset
Sonner-style viewport offsets (offset / mobileOffset).
ToastRequest
ToastStore
ToastSwipeConfig
ToastSwipeDirections
Sonner-style swipe direction allowlist (the swipeDirections toaster prop).
ToastTextStyle
ToastVariantColors
ToastVariantPalette
WidgetStateProperty
WidgetStates

Enums§

ColorFallback
ColorRef
Items
Tailwind-like items-* vocabulary (component-layer).
Justify
Tailwind-like justify-* vocabulary (component-layer).
LengthRefinement
MarginEdge
Margin edges support auto in addition to px/token lengths.
MetricRef
OverflowRefinement
Tailwind-like overflow vocabulary (component-layer).
Radius
Tailwind-like border radius presets for component libraries.
ShadowPreset
SignedMetricRef
Size
Component sizing vocabulary inspired by Tailwind/shadcn and gpui-component.
Space
Tailwind-like spacing scale for component libraries.
ToastAsyncMsg
ToastDescription
ToastDuration
ToastIconOverride
ToastPosition
ToastSwipeDirection
Mirrors Radix toast swipeDirection (left/right/up/down).
ToastVariant
WidgetState

Constants§

DEFAULT_MAX_TOASTS
DEFAULT_TOAST_DURATION
DEFAULT_VISIBLE_TOASTS
TOAST_VIEWPORT_FOCUS_COMMAND
Radix ToastViewport focus-jump command (default hotkey: F8).
TOAST_VIEWPORT_RESTORE_COMMAND
Restores focus after a ToastViewport focus jump (default hotkey: Escape while focused).

Traits§

RefineStyle
Sizable
Shared component API for size configuration.
Stylable
StyledExt

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-kit overlay substrates.

Type Aliases§

OverrideSlot
ADR 0220 override slot shape.