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§
Sourcefn window_insets_padding(self, insets: WindowInsets) -> Modifier
fn window_insets_padding(self, insets: WindowInsets) -> Modifier
Pads and consumes the space not already occupied by enclosing inset modifiers.
Sourcefn consume_window_insets(self, insets: WindowInsets) -> Modifier
fn consume_window_insets(self, insets: WindowInsets) -> Modifier
Marks inset space as occupied for nested padding and size modifiers.
Sourcefn window_insets_left_width(self, insets: WindowInsets) -> Modifier
fn window_insets_left_width(self, insets: WindowInsets) -> Modifier
Sets width to the remaining left window inset.
Sourcefn window_insets_top_height(self, insets: WindowInsets) -> Modifier
fn window_insets_top_height(self, insets: WindowInsets) -> Modifier
Sets height to the remaining top window inset.
Sourcefn window_insets_right_width(self, insets: WindowInsets) -> Modifier
fn window_insets_right_width(self, insets: WindowInsets) -> Modifier
Sets width to the remaining right window inset.
Sourcefn window_insets_bottom_height(self, insets: WindowInsets) -> Modifier
fn window_insets_bottom_height(self, insets: WindowInsets) -> Modifier
Sets height to the remaining bottom window inset.
Sourcefn padding_all(self, padding: Dp) -> Modifier
fn padding_all(self, padding: Dp) -> Modifier
Adds symmetric padding on all edges.
Sourcefn padding_symmetric(self, horizontal: Dp, vertical: Dp) -> Modifier
fn padding_symmetric(self, horizontal: Dp, vertical: Dp) -> Modifier
Adds symmetric padding for horizontal and vertical edges.
Sourcefn clip_to_bounds(self) -> Modifier
fn clip_to_bounds(self) -> Modifier
Clips descendants to this modifier’s bounds.
Sourcefn clip_shape(self, shape: Shape) -> Modifier
fn clip_shape(self, shape: Shape) -> Modifier
Clips this node and its descendants to a shape without resizing content.
Sourcefn vertical_scroll(self, controller: State<ScrollableController>) -> Modifier
fn vertical_scroll(self, controller: State<ScrollableController>) -> Modifier
Makes this node a vertical scroll viewport driven by controller.
Sourcefn horizontal_scroll(self, controller: State<ScrollableController>) -> Modifier
fn horizontal_scroll(self, controller: State<ScrollableController>) -> Modifier
Makes this node a horizontal scroll viewport driven by controller.
Sourcefn scroll(
self,
controller: State<ScrollableController>,
vertical: bool,
horizontal: bool,
) -> Modifier
fn scroll( self, controller: State<ScrollableController>, vertical: bool, horizontal: bool, ) -> Modifier
Makes this node a scroll viewport on the selected axes.
Sourcefn background(self, color: Color) -> Modifier
fn background(self, color: Color) -> Modifier
Draws a background behind the subtree.
Sourcefn background_with_shape(self, color: Color, shape: Shape) -> Modifier
fn background_with_shape(self, color: Color, shape: Shape) -> Modifier
Draws a background behind the subtree using a custom shape.
Sourcefn background_with_scaled_shape(
self,
color: Color,
shape: Shape,
scale: [f32; 2],
) -> Modifier
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.
Sourcefn border_with_shape(self, width: Dp, color: Color, shape: Shape) -> Modifier
fn border_with_shape(self, width: Dp, color: Color, shape: Shape) -> Modifier
Draws a border stroke above the subtree using a custom shape.
Sourcefn shadow(self, scheme: &MaterialColorScheme, args: &ShadowArgs) -> Modifier
fn shadow(self, scheme: &MaterialColorScheme, args: &ShadowArgs) -> Modifier
Adds a shadow with advanced configuration options.
Sourcefn size(self, width: Dp, height: Dp) -> Modifier
fn size(self, width: Dp, height: Dp) -> Modifier
Constrains the content to an exact size when possible.
Sourcefn required_size(self, width: Dp, height: Dp) -> Modifier
fn required_size(self, width: Dp, height: Dp) -> Modifier
Pins the content to an exact size regardless of incoming constraints.
Sourcefn required_width(self, width: Dp) -> Modifier
fn required_width(self, width: Dp) -> Modifier
Pins the content width regardless of incoming constraints.
Sourcefn required_height(self, height: Dp) -> Modifier
fn required_height(self, height: Dp) -> Modifier
Pins the content height regardless of incoming constraints.
Sourcefn default_min_size(self, min_width: Dp, min_height: Dp) -> Modifier
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.
Sourcefn height(self, height: Dp) -> Modifier
fn height(self, height: Dp) -> Modifier
Constrains the content to an exact height when possible.
Sourcefn size_in(
self,
min_width: Option<Dp>,
max_width: Option<Dp>,
min_height: Option<Dp>,
max_height: Option<Dp>,
) -> Modifier
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.
Sourcefn constrain(
self,
width: Option<AxisConstraint>,
height: Option<AxisConstraint>,
) -> Modifier
fn constrain( self, width: Option<AxisConstraint>, height: Option<AxisConstraint>, ) -> Modifier
Applies explicit width/height interval constraints.
Sourcefn fill_max_width(self) -> Modifier
fn fill_max_width(self) -> Modifier
Fills the available width within parent bounds.
Sourcefn fill_max_height(self) -> Modifier
fn fill_max_height(self) -> Modifier
Fills the available height within parent bounds.
Sourcefn fill_max_size(self) -> Modifier
fn fill_max_size(self) -> Modifier
Fills the available size within parent bounds.
Sourcefn minimum_interactive_component_size(self) -> Modifier
fn minimum_interactive_component_size(self) -> Modifier
Enforces a minimum interactive size by expanding and centering content.
Sourcefn weight(self, weight: f32) -> Modifier
fn weight(self, weight: f32) -> Modifier
Provides weighted parent data for row and column layouts.
Sourcefn align(self, alignment: Alignment) -> Modifier
fn align(self, alignment: Alignment) -> Modifier
Provides alignment parent data for layered boxed layouts.
Sourcefn draggable_with(self, args: DraggableArgs) -> Modifier
fn draggable_with(self, args: DraggableArgs) -> Modifier
Emits drag deltas with custom drag configuration.
Sourcefn block_touch_propagation(self) -> Modifier
fn block_touch_propagation(self) -> Modifier
Prevents cursor events from propagating to components behind this subtree.
Sourcefn semantics(self, args: SemanticsArgs) -> Modifier
fn semantics(self, args: SemanticsArgs) -> Modifier
Attaches accessibility semantics metadata to this subtree.
Sourcefn clear_and_set_semantics(self, args: SemanticsArgs) -> Modifier
fn clear_and_set_semantics(self, args: SemanticsArgs) -> Modifier
Clears descendant semantics and applies the provided metadata.
Sourcefn clickable<C>(self, on_click: C) -> Modifierwhere
C: Into<Callback>,
fn clickable<C>(self, on_click: C) -> Modifierwhere
C: Into<Callback>,
Makes the subtree clickable with optional ripple feedback and an accessibility click action.
Sourcefn clickable_with(self, args: ClickableArgs) -> Modifier
fn clickable_with(self, args: ClickableArgs) -> Modifier
Makes the subtree clickable with advanced configuration options.
Sourcefn toggleable<C>(self, value: bool, on_value_change: C) -> Modifier
fn toggleable<C>(self, value: bool, on_value_change: C) -> Modifier
Makes the subtree toggleable with optional ripple/state-layer feedback.
Sourcefn toggleable_with(self, args: ToggleableArgs) -> Modifier
fn toggleable_with(self, args: ToggleableArgs) -> Modifier
Makes the subtree toggleable with advanced configuration options.
Sourcefn selectable<C>(self, selected: bool, on_click: C) -> Modifierwhere
C: Into<Callback>,
fn selectable<C>(self, selected: bool, on_click: C) -> Modifierwhere
C: Into<Callback>,
Makes the subtree selectable with optional ripple/state-layer feedback.
Sourcefn selectable_with(self, args: SelectableArgs) -> Modifier
fn selectable_with(self, args: SelectableArgs) -> Modifier
Makes the subtree selectable with advanced configuration options.
Sourcefn window_drag_region(self) -> Modifier
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".