Skip to main content Module prelude Copy item path Source pub use freya_router ;routerpub use crate::components ::*;data emittable executor measurer modifiers name platform AccentColor accent-colorThe user’s current system wide accent color preference. AccessibilityData AccessibilityId The stable identity of a [Node], unique within the node’s tree. AccessibilityState AnimationClock Border An outline drawn around an element, with a fill color,
a width per side and an alignment . BorderWidth Width of each side of a Border , in pixels. Bytes A cheaply cloneable and sliceable chunk of contiguous memory. Callback Clipboard Access the clipboard. Color Represents one color.
You may create Color s using ConicGradient A gradient that transitions colors by sweeping around the element’s center. CornerRadius Radius applied to each corner of an element to round it, plus an optional
smoothing factor (0.0..=1.0) that turns sharp rounding into a squircle. Cursor CursorStyleData Effect EffectData EffectState Event EventHandler EventsCombos FileEventData FontSize Defaults to 16. FontWeight Thickness of a font, from 100 (thin) to 1000. Defaults to FontWeight::NORMAL (400). FontWidth Horizontal width (condensed to expanded) of a font. Defaults to FontWidth::NORMAL . FutureTask Gaps Spacing applied around the four sides of an element, used for padding and margin. GradientStop A single color stop within a gradient, placed at an offset percentage (0.0..=100.0). ImePreeditEventData KeyboardEventData Data of a Keyboard event. Label LaunchConfig winitConfiguration for the initial state of the application. LayerState LayoutData LinearGradient A gradient that transitions colors along a straight line at a given angle . Memo Modifiers Pressed modifier keys. MouseEventData NoArgCallback OwnedTaskHandle A task handle that cancels the task when the last clone is dropped. Paragraph ParagraphHolder A shared slot that receives the laid-out paragraph, so callers can hit-test and measure
text after layout. Pass it to a paragraph() with Paragraph::holder . Platform Access point to different Freya-managed states such as the focused node,
root window size, navigation mode, and theme preference. RadialGradient A gradient that transitions colors outward in a circle from the element’s center. ReactiveContext Readable A type-erased readable state that only exposes the value type T. Rect RenderContext RendererContext winitRenderingTicker Scale A scale factor applied to an element on each axis, where 1.0 is the original size. ScopeId ScreenReader ShaderFill A custom paint source backed by an SkSL shader. Shadow A shadow cast by an element. SizedEventData Data of a Sized event. Span A run of text with its own style, used to build a paragraph() . Srgba A color in the sRGB color space. Each component is in the range [0, 1]. State A reactive state container that holds a value of type T and manages subscriptions to changes. StyleState Svg SvgBytes SVG bytes that can be constructed from Bytes , Vec<u8> , &'static [u8],
or &'static [u8; N] (the type returned by include_bytes! ). Task TaskHandle TaskId TaskWaker TextShadow A shadow cast behind text, with a Color , an (x, y) offset and a blur sigma. TextStyleData TextStyleState TouchEventData Data of a Touch event. TransformOrigin Reference point that the scale and rotation effects of an element pivot around. UseId WheelEventData Data of a Wheel event. WindowConfig winitConfiguration for a Window. Writable A type-erased writable state that only exposes the value type T. AccessibilityFocusMovement Strategy focusing an Accessibility Node. AccessibilityFocusStrategy Strategy focusing an Accessibility Node. AccessibilityRole The type of an accessibility node. Alignment AspectRatio How an image is scaled to fit its bounds while preserving its aspect ratio. BorderAlignment Where a Border is drawn relative to the element’s edge. BorderShape ClipboardError CloseDecision winitDecision returned by the on_close hook to determine whether a window should close. Code Code is the physical position of a key. Content CursorIcon Describes the appearance of the (usually mouse) cursor icon. CursorMode Determines how the cursor and highlights are positioned within a Paragraph. CursorStyle Shape of the text cursor drawn in a paragraph . DiffKey Direction Element EventType Fill A paint source for backgrounds and text: a solid Color , a gradient or a custom shader. Focus Focus state for an AccessibilityId , distinguishing keyboard vs pointer focus. FocusPressEventData Data delivered to on_focus_press , which can originate from a mouse or a touch. Focusable Whether an element can receive keyboard focus. FontSlant Slant (style) of a font. Force FutureState ImageCover How an image is positioned within its bounds once it has been scaled. Interactive Whether an element (and its descendants) responds to pointer events. Key The value received from the keypress. Layer The painting layer of an element, controlling what it draws on top of. MouseButton NamedKey Key represents the meaning of a keypress. NativeEvent winitNavigationMode OriginValue Position of a TransformOrigin along a single axis. Overflow Whether content overflowing an element’s bounds is shown or clipped. PointerEventData Data of a pointer event. Position How an element is placed relative to its parent or the window. PreferredTheme PressEventData Data delivered to on_press , which can originate from a mouse, the keyboard or a touch. PressEventType ReadableRef SamplingMode The filtering algorithm used when an image is scaled. ShadowPosition Whether a Shadow is cast outside the element or inside it. Size TextAlign Horizontal alignment of text within its element. TextDecoration A line drawn through, under or over text. TextHeightBehavior Controls whether the extra leading height of the first and last lines is kept or trimmed. TextOverflow How text that does not fit its bounds is truncated. TextWidth Whether text sizes itself to its content or expands to the available width. TouchPhase UserEvent VerticalAlign Vertical alignment for Paragraph text rendering. VisibleSize Controls the percentage of the measured size that will actually be used in layout,
regardless of the element’s own size. WheelSource AccessibilityExt Methods for describing an element in the accessibility tree. AccessibilityIdExt Extension trait for AccessibilityId . App App is a trait for root-level application components.
Types implementing App automatically implement Component and have a
blanket PartialEq implementation that always returns true.ChildrenExt Trait for composing child elements. Component Encapsulate reusable pieces of UI by using the Component trait.
Every Component creates a new layer of state in the app,
meaning that implementors of Component can make use of hooks in their Component::render method. ComponentKey ComponentOwned ContainerExt Methods controlling an element’s position and size constraints. ContainerSizeExt Methods for setting an element’s width and height. ContainerWithContentExt Layout methods for containers that arrange children along a direction axis. CornerRadiusExt Shorthand methods for setting an element’s CornerRadius to common values. DebugExt EffectExt Methods for visual effects applied to an element: clipping, blur, rotation, opacity and scale. EventHandlersExt Methods for attaching event handlers to an element. ImageExt Methods for configuring how an image is scaled and sampled. InteractiveExt Method for controlling whether an element responds to pointer events. IntoElement IntoReadable IntoWritable KeyExt Trait for giving an element a stable identity across renders. KeyboardEventExt Extension trait for KeyboardEventData with focus-related helpers. LayerExt Method for controlling which painting layer an element belongs to. LayoutExt Low-level access to an element’s LayoutData . ListExt Trait for concatenating two lists into one. MaybeExt Methods for applying changes to an element conditionally. ModifiersExt Extension trait for Modifiers adding OS-aware helpers. ScrollableExt ShaderProvider StyleExt Methods for styling an element’s box: background, borders, shadows and corners. TextStyleExt Methods for styling the text rendered by an element and inherited by its children. WindowDragExt winitWinitPlatformExt winitExtension trait that adds winit-specific window management capabilities to Platform . WritableUtils A shared interface for types that provide reactive write access to a value of type T. consume_context consume_root_context current_scope_id label Draw text with label() . Its a simplified version of crate::elements::paragraph . launch winitmark_scope_as_dirty paragraph paragraph() makes it possible to render rich text with different styles. Its a more customizable API than crate::elements::label .provide_context provide_context_for_scope_id provide_root_context Store the given value in the root scope. rect rect() acts as a generic container to contain other elements inside, like a box.spawn spawn_forever svg Use svg() to render SVG in your app. try_consume_context try_consume_context_from_scope_id try_consume_own_context Try to get a context value stored only in the current scope, without walking up to ancestors. try_consume_root_context use_a11y Create a unique AccessibilityId that persists for the lifetime of the component. use_after_side_effect use_consume Get access to a value stored in this component instance or some ancestor. use_drop Run a callback for when the component gets dropped. Useful to clean resources. use_focus Reactively track the Focus state of an AccessibilityId . use_future Creata FutureTask with the given callback. use_hook This is the foundational hook used by all. It’s simple, it accepts an initialization callback
whose return value will be stored in this component instance until its dropped.
In subsequent renders the returned value of the function will be a Clone d value of what
had been previously returned by the initialization callback. use_id Get a unique for a given generic type. use_memo Registers a callback that will run every time a State which was .read() inside, changes.
It also returning a type that will get cached after the callback runs, thus allowing this to be used as a way to cache expensive values. use_previous_and_current Track the previous and current values of a reactive value. use_provide_context Store the given value in this component instance.
Any descendant component of this component calling use_consume or consume_context will have access to it. use_provide_root_context Store the given value in the root scope. use_reactive Convert a borrowed value (&T) into a component-scoped State<T> . use_side_effect Registers a callback that will run every time a State which was .read() inside, changes. use_side_effect_value use_side_effect_with_deps use_state Creates a reactive state value initialized with the returned value of the init callback. use_try_consume Try to get access to a value stored in this component instance or some ancestor. Area Area used by a Node, including its margins. CursorPoint ReadRef Size2D WriteRef