Struct floating_ui_dom::FlipOptions
source · pub struct FlipOptions<Element>where
Element: Clone,{
pub detect_overflow: Option<DetectOverflowOptions<Element>>,
pub main_axis: Option<bool>,
pub cross_axis: Option<bool>,
pub fallback_placements: Option<Vec<Placement>>,
pub fallback_strategy: Option<FallbackStrategy>,
pub fallback_axis_side_direction: Option<Alignment>,
pub flip_alignment: Option<bool>,
}
Expand description
Options for Flip
middleware.
Fields§
§detect_overflow: Option<DetectOverflowOptions<Element>>
Options for detect_overflow
.
Defaults to DetectOverflowOptions::default
.
main_axis: Option<bool>
The axis that runs along the side of the floating element. Determines whether overflow along this axis is checked to perform a flip.
Defaults to true
.
cross_axis: Option<bool>
The axis that runs along the alignment of the floating element. Determines whether overflow along this axis is checked to perform a flip.
Defaults to true
.
fallback_placements: Option<Vec<Placement>>
Placements to try sequentially if the preferred placement
does not fit.
Defaults to the opposite placement.
fallback_strategy: Option<FallbackStrategy>
What strategy to use when no placements fit.
Defaults to FallbackStrategy::BestFit
.
fallback_axis_side_direction: Option<Alignment>
Whether to allow fallback to the perpendicular axis of the preferred placement, and if so, which side direction along the axis to prefer.
Defaults to Option::None
(disallow fallback).
flip_alignment: Option<bool>
Whether to flip to placements with the opposite alignment if they fit better.
Defaults to true
.
Implementations§
source§impl<Element> FlipOptions<Element>where
Element: Clone,
impl<Element> FlipOptions<Element>where
Element: Clone,
sourcepub fn detect_overflow(
self,
value: DetectOverflowOptions<Element>
) -> FlipOptions<Element>
pub fn detect_overflow( self, value: DetectOverflowOptions<Element> ) -> FlipOptions<Element>
Set detect_overflow
option.
sourcepub fn main_axis(self, value: bool) -> FlipOptions<Element>
pub fn main_axis(self, value: bool) -> FlipOptions<Element>
Set main_axis
option.
sourcepub fn cross_axis(self, value: bool) -> FlipOptions<Element>
pub fn cross_axis(self, value: bool) -> FlipOptions<Element>
Set cross_axis
option.
sourcepub fn fallback_placements(self, value: Vec<Placement>) -> FlipOptions<Element>
pub fn fallback_placements(self, value: Vec<Placement>) -> FlipOptions<Element>
Set fallback_placements
option.
sourcepub fn fallback_strategy(self, value: FallbackStrategy) -> FlipOptions<Element>
pub fn fallback_strategy(self, value: FallbackStrategy) -> FlipOptions<Element>
Set fallback_strategy
option.
sourcepub fn fallback_axis_side_direction(
self,
value: Alignment
) -> FlipOptions<Element>
pub fn fallback_axis_side_direction( self, value: Alignment ) -> FlipOptions<Element>
Set fallback_axis_side_direction
option.
sourcepub fn flip_alignment(self, value: bool) -> FlipOptions<Element>
pub fn flip_alignment(self, value: bool) -> FlipOptions<Element>
Set flip_alignment
option.
Trait Implementations§
source§impl<Element> Clone for FlipOptions<Element>where
Element: Clone,
impl<Element> Clone for FlipOptions<Element>where
Element: Clone,
source§fn clone(&self) -> FlipOptions<Element>
fn clone(&self) -> FlipOptions<Element>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more