Skip to main content

ModifierExt

Trait ModifierExt 

Source
pub trait ModifierExt {
Show 49 methods // Required methods fn window_insets_padding(self, insets: WindowInsets) -> Modifier; fn consume_window_insets(self, insets: WindowInsets) -> Modifier; fn window_insets_left_width(self, insets: WindowInsets) -> Modifier; fn window_insets_top_height(self, insets: WindowInsets) -> Modifier; fn window_insets_right_width(self, insets: WindowInsets) -> Modifier; fn window_insets_bottom_height(self, insets: WindowInsets) -> Modifier; fn padding(self, padding: Padding) -> Modifier; fn padding_all(self, padding: Dp) -> Modifier; fn padding_symmetric(self, horizontal: Dp, vertical: Dp) -> Modifier; fn offset(self, x: Dp, y: Dp) -> Modifier; fn alpha(self, alpha: f32) -> Modifier; fn clip_to_bounds(self) -> Modifier; fn clip_shape(self, shape: Shape) -> Modifier; fn vertical_scroll( self, controller: State<ScrollableController>, ) -> Modifier; fn horizontal_scroll( self, controller: State<ScrollableController>, ) -> Modifier; fn scroll( self, controller: State<ScrollableController>, vertical: bool, horizontal: bool, ) -> Modifier; fn background(self, color: Color) -> Modifier; fn background_with_shape(self, color: Color, shape: Shape) -> Modifier; fn background_with_scaled_shape( self, color: Color, shape: Shape, scale: [f32; 2], ) -> Modifier; fn border(self, width: Dp, color: Color) -> Modifier; fn border_with_shape( self, width: Dp, color: Color, shape: Shape, ) -> Modifier; fn shadow(self, scheme: &MaterialColorScheme, args: &ShadowArgs) -> Modifier; fn size(self, width: Dp, height: Dp) -> Modifier; fn required_size(self, width: Dp, height: Dp) -> Modifier; fn required_width(self, width: Dp) -> Modifier; fn required_height(self, height: Dp) -> Modifier; fn default_min_size(self, min_width: Dp, min_height: Dp) -> Modifier; fn width(self, width: Dp) -> Modifier; fn height(self, height: Dp) -> Modifier; fn size_in( self, min_width: Option<Dp>, max_width: Option<Dp>, min_height: Option<Dp>, max_height: Option<Dp>, ) -> Modifier; fn constrain( self, width: Option<AxisConstraint>, height: Option<AxisConstraint>, ) -> Modifier; fn fill_max_width(self) -> Modifier; fn fill_max_height(self) -> Modifier; fn fill_max_size(self) -> Modifier; fn minimum_interactive_component_size(self) -> Modifier; fn weight(self, weight: f32) -> Modifier; fn align(self, alignment: Alignment) -> Modifier; fn draggable<C>(self, on_drag_delta: C) -> Modifier where C: Into<CallbackWith<DragDelta, ()>>; fn draggable_with(self, args: DraggableArgs) -> Modifier; fn block_touch_propagation(self) -> Modifier; fn semantics(self, args: SemanticsArgs) -> Modifier; fn clear_and_set_semantics(self, args: SemanticsArgs) -> Modifier; fn clickable<C>(self, on_click: C) -> Modifier where C: Into<Callback>; fn clickable_with(self, args: ClickableArgs) -> Modifier; fn toggleable<C>(self, value: bool, on_value_change: C) -> Modifier where C: Into<CallbackWith<bool, ()>>; fn toggleable_with(self, args: ToggleableArgs) -> Modifier; fn selectable<C>(self, selected: bool, on_click: C) -> Modifier where C: Into<Callback>; fn selectable_with(self, args: SelectableArgs) -> Modifier; fn window_drag_region(self) -> Modifier;
}
Expand description

Extensions for composing reusable wrapper behavior around component subtrees.

Required Methods§

Source

fn window_insets_padding(self, insets: WindowInsets) -> Modifier

Pads and consumes the space not already occupied by enclosing inset modifiers.

Source

fn consume_window_insets(self, insets: WindowInsets) -> Modifier

Marks inset space as occupied for nested padding and size modifiers.

Source

fn window_insets_left_width(self, insets: WindowInsets) -> Modifier

Sets width to the remaining left window inset.

Source

fn window_insets_top_height(self, insets: WindowInsets) -> Modifier

Sets height to the remaining top window inset.

Source

fn window_insets_right_width(self, insets: WindowInsets) -> Modifier

Sets width to the remaining right window inset.

Source

fn window_insets_bottom_height(self, insets: WindowInsets) -> Modifier

Sets height to the remaining bottom window inset.

Source

fn padding(self, padding: Padding) -> Modifier

Adds padding around the content.

Source

fn padding_all(self, padding: Dp) -> Modifier

Adds symmetric padding on all edges.

Source

fn padding_symmetric(self, horizontal: Dp, vertical: Dp) -> Modifier

Adds symmetric padding for horizontal and vertical edges.

Source

fn offset(self, x: Dp, y: Dp) -> Modifier

Offsets the content without affecting layout size.

Source

fn alpha(self, alpha: f32) -> Modifier

Multiplies the opacity of the subtree by alpha.

Source

fn clip_to_bounds(self) -> Modifier

Clips descendants to this modifier’s bounds.

Source

fn clip_shape(self, shape: Shape) -> Modifier

Clips this node and its descendants to a shape without resizing content.

Source

fn vertical_scroll(self, controller: State<ScrollableController>) -> Modifier

Makes this node a vertical scroll viewport driven by controller.

Source

fn horizontal_scroll(self, controller: State<ScrollableController>) -> Modifier

Makes this node a horizontal scroll viewport driven by controller.

Source

fn scroll( self, controller: State<ScrollableController>, vertical: bool, horizontal: bool, ) -> Modifier

Makes this node a scroll viewport on the selected axes.

Source

fn background(self, color: Color) -> Modifier

Draws a background behind the subtree.

Source

fn background_with_shape(self, color: Color, shape: Shape) -> Modifier

Draws a background behind the subtree using a custom shape.

Source

fn background_with_scaled_shape( self, color: Color, shape: Shape, scale: [f32; 2], ) -> Modifier

Draws a background scaled around its center while preserving layout and input bounds.

Both scale axes must be finite and in 0..=1. A zero axis draws nothing.

Source

fn border(self, width: Dp, color: Color) -> Modifier

Draws a border stroke above the subtree.

Source

fn border_with_shape(self, width: Dp, color: Color, shape: Shape) -> Modifier

Draws a border stroke above the subtree using a custom shape.

Source

fn shadow(self, scheme: &MaterialColorScheme, args: &ShadowArgs) -> Modifier

Adds a shadow with advanced configuration options.

Source

fn size(self, width: Dp, height: Dp) -> Modifier

Constrains the content to an exact size when possible.

Source

fn required_size(self, width: Dp, height: Dp) -> Modifier

Pins the content to an exact size regardless of incoming constraints.

Source

fn required_width(self, width: Dp) -> Modifier

Pins the content width regardless of incoming constraints.

Source

fn required_height(self, height: Dp) -> Modifier

Pins the content height regardless of incoming constraints.

Source

fn default_min_size(self, min_width: Dp, min_height: Dp) -> Modifier

Applies a default minimum size only when the incoming axis leaves the minimum open, so an explicit outer size always wins.

Source

fn width(self, width: Dp) -> Modifier

Constrains the content to an exact width when possible.

Source

fn height(self, height: Dp) -> Modifier

Constrains the content to an exact height when possible.

Source

fn size_in( self, min_width: Option<Dp>, max_width: Option<Dp>, min_height: Option<Dp>, max_height: Option<Dp>, ) -> Modifier

Constrains the content size within optional min/max bounds.

Source

fn constrain( self, width: Option<AxisConstraint>, height: Option<AxisConstraint>, ) -> Modifier

Applies explicit width/height interval constraints.

Source

fn fill_max_width(self) -> Modifier

Fills the available width within parent bounds.

Source

fn fill_max_height(self) -> Modifier

Fills the available height within parent bounds.

Source

fn fill_max_size(self) -> Modifier

Fills the available size within parent bounds.

Source

fn minimum_interactive_component_size(self) -> Modifier

Enforces a minimum interactive size by expanding and centering content.

Source

fn weight(self, weight: f32) -> Modifier

Provides weighted parent data for row and column layouts.

Source

fn align(self, alignment: Alignment) -> Modifier

Provides alignment parent data for layered boxed layouts.

Source

fn draggable<C>(self, on_drag_delta: C) -> Modifier
where C: Into<CallbackWith<DragDelta, ()>>,

Emits drag deltas for free-form dragging.

Source

fn draggable_with(self, args: DraggableArgs) -> Modifier

Emits drag deltas with custom drag configuration.

Source

fn block_touch_propagation(self) -> Modifier

Prevents cursor events from propagating to components behind this subtree.

Source

fn semantics(self, args: SemanticsArgs) -> Modifier

Attaches accessibility semantics metadata to this subtree.

Source

fn clear_and_set_semantics(self, args: SemanticsArgs) -> Modifier

Clears descendant semantics and applies the provided metadata.

Source

fn clickable<C>(self, on_click: C) -> Modifier
where C: Into<Callback>,

Makes the subtree clickable with optional ripple feedback and an accessibility click action.

Source

fn clickable_with(self, args: ClickableArgs) -> Modifier

Makes the subtree clickable with advanced configuration options.

Source

fn toggleable<C>(self, value: bool, on_value_change: C) -> Modifier
where C: Into<CallbackWith<bool, ()>>,

Makes the subtree toggleable with optional ripple/state-layer feedback.

Source

fn toggleable_with(self, args: ToggleableArgs) -> Modifier

Makes the subtree toggleable with advanced configuration options.

Source

fn selectable<C>(self, selected: bool, on_click: C) -> Modifier
where C: Into<Callback>,

Makes the subtree selectable with optional ripple/state-layer feedback.

Source

fn selectable_with(self, args: SelectableArgs) -> Modifier

Makes the subtree selectable with advanced configuration options.

Source

fn window_drag_region(self) -> Modifier

Marks this subtree as a draggable window region. On macOS, double-clicking the region follows the system title bar preference.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ModifierExt for Modifier

Source§

fn window_insets_padding(self, insets: WindowInsets) -> Modifier

Source§

fn consume_window_insets(self, insets: WindowInsets) -> Modifier

Source§

fn window_insets_left_width(self, insets: WindowInsets) -> Modifier

Source§

fn window_insets_top_height(self, insets: WindowInsets) -> Modifier

Source§

fn window_insets_right_width(self, insets: WindowInsets) -> Modifier

Source§

fn window_insets_bottom_height(self, insets: WindowInsets) -> Modifier

Source§

fn padding(self, padding: Padding) -> Modifier

Source§

fn padding_all(self, padding: Dp) -> Modifier

Source§

fn padding_symmetric(self, horizontal: Dp, vertical: Dp) -> Modifier

Source§

fn offset(self, x: Dp, y: Dp) -> Modifier

Source§

fn alpha(self, alpha: f32) -> Modifier

Source§

fn clip_to_bounds(self) -> Modifier

Source§

fn clip_shape(self, shape: Shape) -> Modifier

Source§

fn vertical_scroll(self, controller: State<ScrollableController>) -> Modifier

Source§

fn horizontal_scroll(self, controller: State<ScrollableController>) -> Modifier

Source§

fn scroll( self, controller: State<ScrollableController>, vertical: bool, horizontal: bool, ) -> Modifier

Source§

fn background(self, color: Color) -> Modifier

Source§

fn background_with_shape(self, color: Color, shape: Shape) -> Modifier

Source§

fn background_with_scaled_shape( self, color: Color, shape: Shape, scale: [f32; 2], ) -> Modifier

Source§

fn border(self, width: Dp, color: Color) -> Modifier

Source§

fn border_with_shape(self, width: Dp, color: Color, shape: Shape) -> Modifier

Source§

fn shadow(self, scheme: &MaterialColorScheme, args: &ShadowArgs) -> Modifier

Source§

fn default_min_size(self, min_width: Dp, min_height: Dp) -> Modifier

Source§

fn size(self, width: Dp, height: Dp) -> Modifier

Source§

fn required_size(self, width: Dp, height: Dp) -> Modifier

Source§

fn required_width(self, width: Dp) -> Modifier

Source§

fn required_height(self, height: Dp) -> Modifier

Source§

fn width(self, width: Dp) -> Modifier

Source§

fn height(self, height: Dp) -> Modifier

Source§

fn size_in( self, min_width: Option<Dp>, max_width: Option<Dp>, min_height: Option<Dp>, max_height: Option<Dp>, ) -> Modifier

Source§

fn constrain( self, width: Option<AxisConstraint>, height: Option<AxisConstraint>, ) -> Modifier

Source§

fn fill_max_width(self) -> Modifier

Source§

fn fill_max_height(self) -> Modifier

Source§

fn fill_max_size(self) -> Modifier

Source§

fn minimum_interactive_component_size(self) -> Modifier

Source§

fn weight(self, weight: f32) -> Modifier

Source§

fn align(self, alignment: Alignment) -> Modifier

Source§

fn draggable<C>(self, on_drag_delta: C) -> Modifier
where C: Into<CallbackWith<DragDelta, ()>>,

Source§

fn draggable_with(self, args: DraggableArgs) -> Modifier

Source§

fn block_touch_propagation(self) -> Modifier

Source§

fn semantics(self, args: SemanticsArgs) -> Modifier

Source§

fn clear_and_set_semantics(self, args: SemanticsArgs) -> Modifier

Source§

fn clickable<C>(self, on_click: C) -> Modifier
where C: Into<Callback>,

Source§

fn clickable_with(self, args: ClickableArgs) -> Modifier

Source§

fn toggleable<C>(self, value: bool, on_value_change: C) -> Modifier
where C: Into<CallbackWith<bool, ()>>,

Source§

fn toggleable_with(self, args: ToggleableArgs) -> Modifier

Source§

fn selectable<C>(self, selected: bool, on_click: C) -> Modifier
where C: Into<Callback>,

Source§

fn selectable_with(self, args: SelectableArgs) -> Modifier

Source§

fn window_drag_region(self) -> Modifier

Implementors§