Skip to main content

Crate sui

Crate sui 

Source
Expand description

Public Rust facade for SUI.

Most applications can import prelude and construct an App with one or more Window values. Lower-level runtime, scene, renderer, and widget types are re-exported for custom widgets, embedding, tests, and tooling.

use sui::prelude::*;

fn main() -> Result<()> {
    App::new()
        .main_window("Hello SUI", Label::new("Ready"))
        .run()
}

Re-exports§

pub use app::UiHandle;
pub use app::App;
pub use app::ResourceRegistry;
pub use app::Window;

Modules§

app
User-facing application, window, resource, and wake-handle builders.
composites
Composite widgets and application-shell building blocks.
containers
Layout and containment widgets.
controls
Primitive controls, labels, inputs, and icons.
diagnostics
Common imports for ordinary SUI application and widget code. Tooling plumbing for inspectors, tests, and benchmarks: frame timings and scene statistics, inspector snapshots and traces, renderer debug captures, desktop automation, and accessibility audits. Applications rarely need it.
prelude

Structs§

ActionCard
ActionTileGeometry
Where paint_action_tile puts each part of a tile. Build it to size a tile for the theme’s text, or to place a control in the slot that ActionTilePaint::trailing_width keeps clear; painting uses the same geometry.
ActionTilePaint
AdaptiveBreakpoints
Width thresholds used by adaptive widgets.
AdaptiveView
Retains one subtree per presentation class and switches between them based on the space allocated by the parent.
Align
AnimatedValue
A value animated by elapsed time: call AnimatedValue::tick with each frame’s delta. Retargeting keeps momentum like MotionValue.
AnimationBinding
AnimationBindingInvalidation
AnimationDocument
AnimationDocumentFormatError
AnimationEditorState
AnimationPlayer
AnimationPropertyPath
AnimationSelection
AnimationTargetId
AnimationTick
Application
Lower-level application builder for runtime and platform integration.
ArrangeCtx
AspectRatio
Constrains one retained child to an aspect ratio without specializing it as an image or media widget.
AsyncWakeToken
Background
BasicSyntaxHighlighter
Lightweight dependency-free lexer used by the default code-block renderer.
Blink
Border
BottomSheet
A modal surface anchored to the bottom edge of its allocated viewport.
Breadcrumb
BreadcrumbItem
BrowserTabBar
BrushPreview
BrushPreviewSpec
Button
CalloutPaint
Canvas
CanvasColors
Widget-owned canvas color overrides. Unset fields resolve from common semantic theme roles on every paint, preserving live theme switching.
CanvasRuler
CanvasRulerColors
CanvasStroke
CanvasSurface
Reusable paint-only canvas background and world-space transform.
CanvasViewport
CanvasZoomContext
Changed
Future returned by Observable::changed and Signal::changed.
Checkbox
CheckboxIndicatorState
Clip
Clipboard
Shared handle to the clipboard service.
CodePanelPaint
CodeTextLine
CodeTextPaint
CodeTextSpan
CollectionAnchor
CollectionExtentIndex
Variable-height prefix-sum index used by virtual collection policies.
CollectionWindow
Describes the loaded slice of a potentially larger collection.
Color
ColorPalette
ColorPaletteSwatch
ColorPicker
ColorPickerColors
Widget-owned color-tool paint overrides. The default appearance is derived from common semantic theme roles rather than global picker-specific tokens.
ColorSwatch
Command
Borrowed view of a command while it is delivered on the UI thread.
CommandButtonPaint
CommandCtx
Context supplied to window and application command controllers.
CommandGroup
CommandKey
A process-local, strongly typed command identifier.
CommandPalette
Modal presentation shell for application command search and execution.
CommandSender
Cloneable, thread-safe producer for application commands.
CompiledClip
CompiledTimeline
CompiledTrack
ConstraintQuery
Serializable, locally evaluated container query.
ConstraintView
Retains each declarative query branch and visits only the first matching one.
Constraints
ContextMenu
ContextMenuHandle
Opens a ContextMenu from code, at a point. For a trigger that decides for itself when a menu is asked for, such as a canvas that pans with the right button and wants a menu only for a right-click that does not drag: it handles the press, and opens the menu with Self::open_at.
ControlMetrics
ControlPalette
ControlTypography
CoverageDots
CoverageDotsConfig
CustomEvent
DateTimeInput
A lightweight single-line local date/time field. Values remain strings so applications can choose their own parsing, timezone, and validation rules; the suggested format is YYYY-MM-DD HH:MM.
DecorativeColors
Vibrant categorical source colors with matched OKLCH lightness and chroma, so no hue shouts over another.
DecorativePalette
Derived ToneRoles for every DecorativeHue.
DefaultTheme
DesktopExtensionContext
Read-only state supplied to a DesktopExtension update.
DesktopPlatform
DesktopWindow
A live winit window exposed to a desktop extension.
DetailRow
Dialog
DirtyRegion
DisclosureButtonPaint
DisplayCapabilities
Dock
Vertical dock layout with optional fixed-height top and bottom slots.
DockFloatingGroup
A tab group floating above the docked graph inside the same SUI window.
DockLayoutError
Validation or mutation failure for a docking layout.
DockPanel
DockPanelId
Stable application-defined identity for one dockable panel.
DockPanelOptions
Presentation and behavior of one dock panel’s tab.
DockWorkspace
Retained editor workspace with a split/tab dock graph and same-window floating panels.
DockWorkspaceSnapshot
Plain persistence boundary for a docking workspace.
DockWorkspaceState
Cloneable observable state for DockWorkspace.
DpiInfo
DragDropHost
DragDropScope
DragEvent
DragPreview
DragScopeId
DragSessionId
Draggable
DropEffects
A set of drop effects, such as every effect a drag source allows.
DropTarget
EffectToken
ElidedLine
One line of text fitted to a width, ending in “…” when it is cut.
EmbeddedSvgImageResource
EmptyState
EmptyStatePaint
Error
EventCtx
EventRouteStep
FieldGroup
FileDialogFilter
FileDialogRequest
FileDialogSelection
FixedPaneSplit
Flex
FlexItem
FlexItemLayout
FlexLayout
FlexLineLayout
FlexStyle
FloatingStack
FloatingViewConfig
FloatingViewSnapshot
FloatingWorkspace
FloatingWorkspaceState
FocusScope
Retains focus history for a stable child subtree.
FocusScopeState
Shared retained focus history for a FocusScope.
FocusState
FontFamilyStack
An ordered, theme-owned font-family preference list.
FontFeature
A single OpenType feature setting: a 4-byte tag plus a value (0 disables, 1 enables, and larger values select an alternate/parameter for features that take one).
FontFeatures
An ordered collection of OpenType feature settings applied to a text run. Later settings for the same tag take precedence in the shaper.
FontHandle
FontRegistry
FontWeight
OpenType weight axis value. Conventional named weights span 100..=900; for variable fonts any value in the font’s wght range is valid.
FormRow
FormSection
FrameSchedule
FramedField
A reusable field frame for compound editors such as search/composer rows.
GradientStop
Grid
Retained explicit grid container backed by the renderer-independent sui-layout track solver.
GridCell
GridItem
GridItemLayout
GridLayout
GridPlacement
GridStyle
HdrColorRoles
HdrEffectTokens
HdrLuminanceTokens
HdrMaterialTokens
HdrPolicyTokens
HdrThemeTokens
HeadlessPlatform
Icon
IconButton
IconButtonPaint
Image
ImageHandle
ImageRegistry
ImageSource
Insets
IntrinsicSize
Minimum and preferred content extents reported by a widget along one axis.
InvalidationRequest
KeyboardEvent
KeyedChildren
Layout-neutral retained child collection reconciled by stable application keys.
KeyedReconcile
KeyedStack
A row or column of children kept in step with a list of keyed items.
Keyframe
KeyframeSelection
Label
LayerList
LayerListItem
LayerListReorderChange
LayerOptions
LayerProperties
How a retained layer is presented without repainting it: faded, moved, and scaled. Changing these updates the composited layer only.
LayoutContext
LayoutTransition
Animates a retained subtree from its previous arranged origin to its new origin while layout itself immediately settles at the destination.
LeadingLabelCellPaint
Link
ListItem
ListView
LocalClipboardBackend
In-process clipboard storage used when no platform backend is installed.
LocalUrlOpenerBackend
Records URLs instead of opening them; used when no platform backend is installed.
MasterDetail
Shows master and detail side-by-side when space permits, and converts to a focus-restoring navigation stack under compact constraints.
MasterDetailState
Cloneable navigation state shared by a master-detail layout and the app.
MaterialToken
MeasureCtx
MeasuredBottomDock
Vertical dock layout where the bottom child is measured to its natural height.
Menu
MenuItem
Modifiers
Motion
A value the runtime animates for a widget.
MotionPolicy
The motion policy in effect: the user’s MotionPreference plus a time scale for watching transitions in slow motion while debugging.
MotionScalar
A 0-to-1 progress value for widget state transitions (hover, press, focus, reveal) that the widget advances itself from animation frames. Prefer Progress, which the runtime advances.
MotionValue
A value that animates toward its latest target on an absolute clock.
NativeFileDialogs
NeutralRamp
Every structural tier of a theme: surfaces, neutral fills, borders, and ink. Built-in themes author these directly so each preset can choose pure or subtly tinted neutrals; widgets never derive structure from the brand color.
NotificationCenter
Thread-safe producer for transient, window-hosted notifications.
NotificationHost
Window-level visual and semantic host for a NotificationCenter.
NotificationId
NumberInput
ObservableChange
Metadata emitted when an observable value changes.
Observer
Cloneable change observer used by observable implementations.
Oklch
A color in the perceptual OKLCH space: lightness from 0 to 1, chroma from 0 upward (roughly 0.4 at the edge of wide gamuts), and hue in degrees. Equal lightness steps read as equal visual steps, which makes it the natural space for deriving hover, pressed, and contrast variants.
OsClipboardBackend
OS-clipboard bridge backed by arboard, installed into the runtime by the desktop platform so widget copy/paste interoperates with other applications.
OsUrlOpenerBackend
Opens URLs with the program the system registers for their scheme, using the open crate. The desktop platform installs it into the runtime.
OverlayCollisionPolicy
OverlayDismissPolicy
OverlayDismissRequest
OverlayFocusBehavior
Focus behavior shared by every transient presentation policy.
OverlayHost
Defines an independent overlay stacking root.
OverlayOptions
Runtime behavior declared by the logical owner of an overlay.
OverlayPlacement
OverlayPlacementRequest
OverlayPlacementResult
Padding
PaintCtx
PanelSection
Paragraph
Text wrapped to a width and laid out once, to measure and then paint.
PasswordInput
A single-line text input that masks its visible value while retaining the same selection, clipboard, IME, and change-callback behavior as TextInput.
Path
PathBuilder
PersistentTextLayout
PixelCanvas
PixelCanvasColors
PixelCanvasExportSnapshot
PixelCanvasState
PlacementBadge
PlacementBadgePaint
PlatformFile
A file the user chose in a file dialog, or found in a chosen folder.
PlatformFolder
A folder the user chose in a folder dialog, or found inside one.
PlatformWindow
PlaybackSpan
A stretch of timeline the playhead moved over in one tick.
PlaybackState
Point
PointerButtons
PointerEvent
Popover
Presence
Shows or hides one child, animating it in and out.
PresenceTransition
How content looks at the absent end of an enter or exit, and how long each takes.
PresetStrip
Progress
A 0-to-1 progress value for widget state (hover, press, focus, toggle), animated by the runtime.
ProgressBar
PropertyRow
Pulse
PumpedDesktop
A desktop application that its host drives one event-loop turn at a time with pump, instead of blocking in DesktopPlatform::run_with.
RadioButton
RadioGroup
RawMouseMotionEvent
Device-relative mouse motion in the host’s raw, device-specific units.
RebuildOnChange
Hosts a child subtree that is rebuilt whenever a caller-supplied key changes.
RebuildOnConstraints
Hosts a child subtree that is rebuilt whenever layout constraints resolve to a new key.
Rect
RegisteredExternalImage
Renderer-neutral metadata for an image whose pixels are owned outside the frame’s CPU image registry.
RegisteredFont
RegisteredImage
RenderOutput
RendererCapabilities
RendererInterop
ReorderableList
ReorderableListChange
ResolvedEffectStyle
ResolvedHdrStyle
ResolvedMaterialStyle
ResolvedTextFace
ResponsiveSidebar
A stable sidebar/content layout that becomes an overlay drawer in compact constraints and a collapsible rail or inline pane in wider constraints.
ResponsiveSidebarSnapshot
ResponsiveSidebarState
Cloneable application-owned state for a responsive sidebar.
RgbaImage
RichAttachment
RichBlockId
Stable identity for a block in a RichDocumentModel.
RichDocumentBlock
RichDocumentModel
RichDocumentRenderContext
Context passed to an application-defined rich-document block renderer.
RichDocumentRendererRegistry
Registry of block renderers keyed by architecture-neutral names.
RichDocumentSnapshot
RichDocumentSpan
RichDocumentUpdate
RichDocumentView
Retained, selectable, incrementally updating rich-document widget.
RichDocumentViewState
Shareable retained state for a RichDocumentView.
RichExtensionBlock
Application-defined structured block rendered through a registry entry.
RichInlineImage
RichInlineStyle
RichLink
RichListItem
RichSyntaxSpan
RichText
RichTextSourceMap
Original source plus the mapping needed to copy source-preserving rich-text selections.
RichTextSourceSpan
Maps byte ranges in rendered rich text back to the original source.
Runtime
RuntimeApplication
SafeArea
Insets one retained child by the current window’s safe area.
SafeAreaEdges
Selects which edges of SafeArea consume the platform-provided insets.
SafeAreaInsets
SampleBatch
SampleBuffer
SampledAnimationValue
Scene
SceneFrame
ScrollBar
ScrollState
ScrollView
SectionLabel
SectionLabelPaint
SectionPanelGeometry
SectionPanelPaint
SegmentedControl
SegmentedControlItem
Select
SelectionChange
SelectionEntry
SelectionOrder
SelectionOwnerId
SelectionPoint
SelectionScope
Selector
Equality-deduplicated derived observable.
SemanticColorToken
SemanticRegion
SemanticsCtx
SemanticsEvent
An assistive-technology action directed at a semantic node.
SemanticsNode
SemanticsRelations
SemanticsState
SemanticsTextRange
Separator
ShadowBox
Casts shadows and a glow around its child, as a rounded box the size of the child. For anything box-shaped that paints its own face, such as an image or a custom widget, where Surface would paint one too.
ShadowParams
A soft shadow of a rounded box, as CSS box-shadow describes one.
ShapedGlyph
ShapedText
ShapedTextWindow
SheetState
Cloneable presentation state shared by a sheet and application controls.
SideSheet
An overlay panel anchored to a viewport edge.
Signal
Cloneable observable storage with equality-deduplicated writes.
SignalMeter
SimpleColorPicker
SingleChild
Size
SizedBox
Slider
SourceId
Stable identity for one observable source.
Spinner
SplitState
Cloneable, observable split-pane state.
SplitStateSnapshot
SplitView
SpringF32
A spring that follows a moving target, stepped by elapsed time. Use it for physics-driven motion, such as a dragged handle that springs home carrying the velocity of the fling; for transitions between states prefer MotionValue with an AnimationSpec::Spring.
SpringSpec
A spring described the way designers tune one: how long it takes to settle, and how much it bounces.
Stack
StackHostOptions
StackSurfaceOptions
Stagger
Delays that start a group of animations one after another, such as list items cascading in.
StatusBadge
StatusBar
StatusBarHost
StatusBarSegment
StrokeStyle
Subscription
Keeps an observable subscription alive.
Surface
SurfaceId
SurfacePalette
Switch
SwitchView
TabBar
TabBarItem
One navigation tab, measured and painted as a single optional-icon + label item.
Table
TableColumn
TableRow
Tabs
Task
Observable state of a background operation: a Signal holding a TaskState, plus a generation counter that keeps stale workers from overwriting newer results.
TaskHandle
A worker’s reporting channel for one run of a Task.
TextArea
TextBlockPaint
TextCellPaint
TextCluster
TextCursor
TextDocument
TextGlyphInstance
TextInput
A single-line text field. Text wider than the field scrolls sideways inside it, keeping the caret in view while the field has focus.
TextLayout
TextLayoutHandle
TextLayoutId
TextLayoutMetadata
TextLayoutRegistry
TextLayoutRequest
TextLayoutRun
TextLayoutVersion
TextLayoutView
TextLine
TextLineWindow
TextMeasurement
TextParagraph
TextParagraphLayout
TextParagraphStyle
TextPlacement
Where text goes in the rect it is painted into.
TextRenderPolicy
TextRun
TextRunView
TextSelection
TextSelectionGeometry
TextSelectionInfo
TextSpan
TextSpanId
TextStyle
TextSurface
TextSurfaceStatus
Where editing stands in a TextSurface, for an inspector or a status bar (see TextSurface::status).
TextSurfaceStyleOverlay
TextSurfaceStyleSpan
Theme
Application-level colors, built-in widget theme, and custom extensions.
ThemeAspectRatios
ThemeBlurScale
ThemeBreakpoints
ThemeColors
The source colors of a theme. Everything widgets paint — control states, soft washes, legible tone text, focus, selection, and the HDR variants — is derived from these values, so editing any field (for example primary) keeps every dependent role consistent.
ThemeContainers
ThemeExtensions
Type-indexed storage for application-specific theme values.
ThemeFontFamilies
ThemeFontStack
ThemeFontWeights
ThemeGlows
Glow tokens: soft zero-offset halos reserved for live signals (streaming, voice, busy indicators, the primary action). Mesh keeps Light glow-free (light does not glow on paper), gives Dark full glows, and damps Void to protect OLED panels. Paint with paint_theme_glow, after resolving them for the output with DefaultTheme::glow_for_output.
ThemeLeading
ThemeMotion
Motion design tokens: a shared vocabulary of animation durations and easing curves so widgets and applications animate consistently.
ThemePerspective
ThemeRadii
ThemeShadow
ThemeShadowLayer
ThemeShadows
ThemeTextScale
ThemeTextToken
ThemeTracking
Timeline
TimelineMarker
A named point in time on a timeline. Players report the markers the playhead passes, so an app can start the next step of a sequence or play a sound in time with the animation.
TimelinePlayer
TimelineSnap
TimelineTick
TimerToken
ToneRoles
The derived role set for one chromatic source color: the solid fill and its interaction states, a soft wash, ink that stays legible on plain and soft surfaces, and a translucent-looking outline. Every value is opaque, flattened onto the theme panel.
ToolPalette
ToolPaletteItem
Toolbar
Tooltip
Track
TrailingSlotRow
Transform
TransientNotification
Transition
TreeItem
TreeView
UrlOpener
Shared handle to the URL-opening service.
UrlPolicy
Decides which URLs a UrlOpener hands to the platform.
Vector
VirtualCollectionModel
Cloneable observable collection with stable keys and incremental changes.
VirtualList
Data-backed retained virtual list with stable keyed row identity.
VirtualListState
VirtualScrollView
VirtualTable
VirtualTableColumn
VirtualTableRowContext
VirtualTableState
Retained interaction state shared by rebuilt VirtualTable instances.
VirtualViewportSnapshot
Observable projection of a virtual collection viewport.
Waker
A cheap, cloneable, Send handle that wakes the running desktop UI from any thread. Pending wake calls are coalesced into one event-loop signal. This is a scheduler primitive: it does not synthesize or route a widget event.
WeakObserver
Weak observer reference suitable for storage inside custom observables.
WgpuExternalTextureContext
Cloneable access to the renderer-owned WGPU device and queue.
WgpuExternalTextureRegistry
Shared registry for app-owned textures sampled by SUI’s normal image draw path.
WgpuRenderer
WidgetChildren
WidgetDiagnosticsCtx
Collector passed to Widget::diagnostics.
WidgetId
WidgetPod
Standard retained-widget adapter used by the SUI runtime.
WindowBuilder
WindowCursorState
Desired host cursor state for one runtime window.
WindowId
Identifies a host render/input target.
WindowRenderOptions
Zip
Several observables viewed as one tuple-valued source. Built by combine; observing it directly notifies on a change to any input.

Enums§

AdaptiveClass
Constraint-derived presentation class for adaptive workspace layouts.
Alignment
AnimationEditorCommand
AnimationProperty
AnimationSpec
How a value travels to a new target: a timed curve or a spring.
AnimationValue
AnimationValueKind
AspectRatioFit
Axis
Brush
BrushPreviewShape
ButtonAppearance
The visual treatment used by pressable controls.
CanvasGridStyle
CanvasRulerAxis
CanvasShape
CanvasZoomBehavior
ChoiceAppearance
The whole-row visual treatment used by checkbox, switch, and radio controls.
CollectionAnchorGravity
CollectionChange
Incremental mutation accepted by VirtualCollectionModel.
CollectionDelta
Key-only change journal consumed by virtual collection widgets.
CollectionModelError
CollectionSync
Result of asking a collection source for changes after a known revision.
ColorSpace
CommandButtonFill
CommandDelivery
CommandTarget
ConstraintOrientation
ContentExtent
Controls the child’s measured extent along a scrollable axis.
ControlSize
Contextual interface-control sizing.
CursorGrabMode
Requested host behavior for the system cursor.
DecorativeHue
A decorative hue from DecorativeColors. Use decorative hues for categorical emphasis — tags, avatars, node categories, chart series — never for status: status keeps its semantic colors.
DesktopPumpStatus
What a host should do after PumpedDesktop::pump.
DisplayColorPrimaries
DockCloseAction
What the workspace does after a tab’s close button is pressed.
DockNode
One node in the persisted docking graph.
DockPlacement
Where a panel added at runtime first appears.
DockZone
Destination zone used when docking a panel relative to a tab group or the workspace root.
DragEventKind
DragOutcome
DragPayload
DropEffect
DropHover
Whether a drag is over a DropTarget, and what the target made of it.
Easing
Event
EventPhase
EventRoutePhase
FieldAppearance
Whether an editor paints its own field chrome.
FileDialogMode
FlexAlignContent
FlexBasis
FlexJustify
FlexWrap
FocusRestorePolicy
FolderEntry
A file or folder inside a PlatformFolder.
FontStretch
Font width (the standard nine CSS font-stretch keywords / OS/2 width classes).
FontStyle
Font slant.
FramePacing
How a window’s animation frames are timed.
GlowTone
Which of the theme’s glows to draw.
GridTrack
GridTrackMax
HairlineEdge
HdrThemeMode
IconGlyph
ImageFit
ImagePixelSnap
ImageSampling
ImeEvent
InteractionPreview
Pins the interaction visuals of a control.
InvalidationKind
InvalidationTarget
KeyState
LayerCompositionMode
LoopMode
MasterDetailRoute
MotionPreference
How much motion the user wants to see.
NotificationUrgency
OutputColorRange
How far a window’s output reaches beyond sRGB and SDR white.
OutputGamut
The colors an output shows.
Overflow
OverlayAlignment
OverlayDismissReason
OverlayInitialFocus
OverlayKind
Broad behavior category used by diagnostics and accessibility adapters.
OverlayModality
OverlaySide
PaintBoundaryMode
PathElement
PixelCanvasBlendMode
PixelCanvasBrushShape
PixelCanvasTool
PointerButton
PointerEventKind
PointerKind
PopoverAlignment
PropertyRowLayout
RegisteredImageFormat
RequestedToneMappingMode
How extended-range colors fit an SDR output. Colors within SDR range pass through unchanged in every mode, so SDR content looks as authored.
ResponsiveSidebarMode
RichDocumentBlockKind
RichDocumentStatus
RichInlineKind
RichSyntaxTokenKind
SceneCommand
ScrollAlignment
ScrollAxes
ScrollDelta
SelectionClipboardBehavior
Controls whether a selectable widget writes its selection to the clipboard from implicit widget-owned routes such as Ctrl+C and accessibility Copy.
SelectionIntent
SelectionPayload
SemanticTone
SemanticsAction
SemanticsActionRequest
A concrete accessibility action requested by a platform assistive-technology provider.
SemanticsLiveRegion
SemanticsPopupKind
SemanticsRole
SemanticsValue
ShadowPlacement
Where a shadow falls relative to the rounded box that casts it.
SideSheetPlacement
SimpleColorPickerMode
The channel sliders a SimpleColorPicker shows.
SplitExtent
SplitPaneSide
StackOrderPolicy
StaggerOrigin
Where a Stagger starts: the item that animates first.
SurfaceAppearance
SurfaceBorder
SurfaceElevation
SurfaceRole
TableColumnAlignment
TaskState
Lifecycle of a background operation observed through a Task.
TextAffinity
TextAlign
TextCommand
Standard clipboard/selection command understood by text editing widgets.
TextCoveragePolicy
TextDirection
TextFlowDirection
TextOverflow
What a widget does with a label too wide for its space.
TextRenderCoveragePolicy
TextRenderHinting
TextRenderMode
TextRenderStemDarkening
TextSubpixelOrder
TextSurfaceOverlayKind
TextWrap
TextWritingMode
ThemeColorScheme
ThemeDensity
ToggleState
TooltipAlignment
TooltipPlacement
VerticalAlign
Where text goes vertically in the rect it is painted into.
VirtualListChrome
VirtualListSelectionMode
VirtualTableRowActivationKind
VirtualTableSortDirection
WakeEvent
WidgetColorRole
WidgetEffectRole
WidgetLuminanceRole
WidgetMaterialRole
WidgetShader
WindowColorManagementMode
WindowDynamicRangeMode
WindowEvent
WindowIcon
WindowOutputColorPrimaries
WindowToneMappingMode

Constants§

ANIMATION_DOCUMENT_VERSION
BUILTIN_ICON_GLYPHS
DEFAULT_SUI_LOGO_SVG
EXTERNAL_WAKE_KIND
Legacy root-event kind. Platform wakes no longer synthesize this event; use CommandSender and window/application controllers instead.
MIN_ANIMATION_DOCUMENT_VERSION
The oldest document version this build still reads. Version 2 added timeline markers.
OVERLAY_DISMISS_REQUEST
Typed runtime-to-widget request used for centralized dismissal arbitration.
REACTIVE_CHANGED
Internal typed notification delivered to widgets whose observable dependencies changed.
TEXT_COMMAND
Typed command key used for target-only text command delivery.

Traits§

AnimateCtx
A context that can start Motion transitions: event, measure, and arrange contexts.
ClipboardBackend
Storage driver behind a Clipboard handle.
CommandController
Non-widget application service that receives commands on the UI thread. Controllers are owned by their application/window builder and are dropped automatically with that owner.
DesktopExtension
Optional integration driven alongside SUI’s desktop event loop.
FileDialogService
FrameClock
Something that knows the time of the frame being produced: widget contexts, or a plain time in seconds.
Interpolate
Observable
Readable value that can notify subscribers after meaningful changes.
RichSyntaxHighlighter
TextShaper
Lays text out: implemented by the measure and paint contexts, and by LayoutContext.
ThemeExtension
Marker trait for type-indexed application theme extensions.
TimelineBindingSink
UrlOpenerBackend
Driver behind a UrlOpener handle that hands a URL to the platform.
VirtualCollectionSource
Architecture-neutral data source consumed by VirtualList.
Widget
WidgetPodMutVisitor
WidgetPodVisitor

Functions§

app_motion_preference
The app’s motion preference override, if any.
arrange_flex
batch
Run writes and notify each changed Signal once when it returns, instead of after every write.
clear_window_render_options
combine
Derive a value from up to four observables.
combine_named
combine with a diagnostics name.
default_sui_logo_image
detail_row_height_for_value
draw_glyph
Draw an IconGlyph tinted color, centered and fit within bounds. Exposed for bespoke painters (application chrome) that draw an icon mark without composing an Icon widget; the glyph is painted directly as native SUI path geometry.
flex_layout
grid_layout
Lay out items on style’s tracks, adding auto tracks for items placed past them, up to MAX_GRID_TRACKS rows and columns.
invalidation_for_animation_property
motion_policy
The motion policy in effect on this UI thread: the app’s preference if it set one, otherwise the system’s, with the current time scale.
motion_time_scale
How fast transitions play relative to their nominal durations.
paint_action_tile
Paint a tile with a title, an optional subtitle and an optional leading icon, and return where its parts went.
paint_border
paint_callout
paint_canvas_grid
paint_checkbox_indicator
paint_code_lines
paint_code_panel
paint_command_button
paint_coverage_dots
paint_coverage_dots_with_config
paint_detail_row_at
paint_disclosure_button
paint_empty_state
paint_hairline
paint_icon_button
paint_leading_label_cell
paint_placement_badge
paint_placement_badge_with
paint_progress_bar
paint_rounded_panel
paint_rounded_rect
paint_section_label
paint_section_label_detail
paint_section_panel
paint_status_badge
paint_text
Paint text in rect, wrapped to its width and placed by placement.
paint_text_block
paint_text_cell
paint_text_line
Paint text on one line in rect, never wrapping: centered vertically on its capital letters and placed horizontally by align.
paint_text_line_elided
Paint text on one line in rect as paint_text_line does, fitted to the rect’s width as an ElidedLine: cut text ends in “…” rather than in a glyph cut in half.
paint_theme_glow
Paint a glow around a rounded rect: each layer of glow as a halo outside the rect only, so the rect itself stays clear. It can be painted before the rect’s fill or after it; a translucent fill does not show the halo through it. Resolve a theme glow for the output with DefaultTheme::glow_for_output.
paint_theme_inset_shadow
Paint the inset layers of a ThemeShadow inside a rounded-rect surface. Call it after filling the surface and before painting its border and content, as CSS draws inset shadows. Pass the surface inside its border as rect, as CSS does, or the border covers the thinnest layers. Outer layers are left for paint_theme_shadow.
paint_theme_shadow
Paint the outer (drop) layers of a ThemeShadow behind a rounded-rect surface. The tighter second layer is drawn first and the wider/more-diffuse first layer on top — matching CSS box-shadow, where the first-listed shadow is topmost.
place_overlay
Place an overlay relative to an anchor while keeping it inside a viewport.
reset_motion_settings
Forget the system preference, app override, and time scale. Test harnesses call this so each app starts from full motion.
resolve_effect_role
resolve_luminance_role
resolve_material_role
resolve_semantic_color
resolve_widget_hdr_style
set_app_motion_preference
Override the system’s motion preference for this app, or pass None to follow the system again.
set_motion_time_scale
Play transitions at time_scale speed: 0.25 shows them at quarter speed. Meant for inspecting motion while developing.
set_system_motion_preference
Record the operating system’s motion preference. Platform backends call this at startup and when the setting may have changed.
set_window_render_options
show_file_dialog
Show a dialog from an async context.
system_motion_preference
The operating system’s motion preference, as reported by the platform.
window_output_color_range
What window_id’s output can show, once the platform has said.
window_output_color_range_signal
What window_id’s output can show, as a signal to observe. It holds None until the platform has said, as it does without a platform.
window_render_options
wrap_text_lines
Paint one unwrapped line using SUI’s shared optical baseline alignment path. Greedy word-wrap text to max_width, using measure for run widths.

Type Aliases§

FileDialogFuture
Result
A result whose error defaults to SUI’s Error. The error type can be given too, so a glob import of SUI’s prelude leaves Result<T, E> working.
SharedCompiledTimeline
StemDarkening
The renderer’s name for sui_scene::TextRenderStemDarkening.
TextHinting
The renderer’s name for sui_scene::TextRenderHinting.
WindowStemDarkening
A window’s stem darkening, the scene’s sui_scene::TextRenderStemDarkening.
WindowTextCoveragePolicy
A window’s text coverage policy, the scene’s sui_scene::TextRenderCoveragePolicy.
WindowTextHinting
A window’s text hinting, the scene’s sui_scene::TextRenderHinting.
WindowTextSubpixelOrder
A window’s text subpixel order, the scene’s sui_scene::TextSubpixelOrder.