pub struct ImageComparisonProps {Show 18 fields
pub before: Element,
pub after: Element,
pub label: String,
pub before_label: String,
pub after_label: String,
pub value: Option<f64>,
pub default_value: f64,
pub on_value_change: Option<EventHandler<f64>>,
pub mode: ImageComparisonMode,
pub fit: ImageFit,
pub ratio: f64,
pub disabled: bool,
pub drag_extent: f64,
pub name: Option<String>,
pub locale: Option<String>,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
pub children: Element,
}Expand description
Props for ImageComparison.
Fields§
§before: ElementThe before image.
after: ElementThe after image.
label: StringAccessible name of the slider, shown next to it.
before_label: StringLabel of the before image.
after_label: StringLabel of the after image, also read in the slider value.
value: Option<f64>Controlled reveal position, 0 through 100.
default_value: f64Initial reveal position when uncontrolled. Defaults to 50.
on_value_change: Option<EventHandler<f64>>Called with the new position.
mode: ImageComparisonModeDisplay mode.
fit: ImageFitHow the images fill the frame.
ratio: f64Width to height ratio of the frame. Defaults to 16 / 9.
disabled: boolDisables the slider.
drag_extent: f64Frame width in pixels used to turn drag distance into a position when the renderer cannot measure the frame (Dioxus Native). The web and desktop measure it. Defaults to 640.
name: Option<String>Form field name of the slider.
locale: Option<String>BCP 47 locale of the slider value text; defaults to English.
class: Option<String>Extra classes appended after the Lumen class.
attributes: Vec<Attribute>Any other <figure> or global attribute.
children: ElementCaption content after the slider.
Implementations§
Source§impl ImageComparisonProps
impl ImageComparisonProps
Sourcepub fn builder() -> ImageComparisonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ImageComparisonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building ImageComparisonProps.
On the builder, call .before(...), .after(...), .label(...), .before_label(...)(optional), .after_label(...)(optional), .value(...)(optional), .default_value(...)(optional), .on_value_change(...)(optional), .mode(...)(optional), .fit(...)(optional), .ratio(...)(optional), .disabled(...)(optional), .drag_extent(...)(optional), .name(...)(optional), .locale(...)(optional), .class(...)(optional), .attributes(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of ImageComparisonProps.
Trait Implementations§
Source§impl Clone for ImageComparisonProps
impl Clone for ImageComparisonProps
Source§impl PartialEq for ImageComparisonProps
impl PartialEq for ImageComparisonProps
Source§impl Properties for ImageComparisonPropswhere
Self: Clone,
impl Properties for ImageComparisonPropswhere
Self: Clone,
Source§type Builder = ImageComparisonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = ImageComparisonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for ImageComparisonProps
Auto Trait Implementations§
impl !Freeze for ImageComparisonProps
impl !RefUnwindSafe for ImageComparisonProps
impl !Send for ImageComparisonProps
impl !Sync for ImageComparisonProps
impl !UnwindSafe for ImageComparisonProps
impl Forget for ImageComparisonProps
impl Move for ImageComparisonProps
impl Unpin for ImageComparisonPropswhere
Rc<VNodeInner>: Unpin,
Arc<Error>: Unpin,
NonZero<u32>: Unpin,
*const u8 is !null: Unpin,
&'static UnsyncStorage: Unpin,
NonZero<u64>: Unpin,
&'static Location<'static>: Unpin,
Box<dyn FnMut(f64)>: Unpin,
*const RcInner<Runtime> is !null: Unpin,
&'static str: Unpin,
Rc<RefCell<dyn FnMut(Event<dyn Any>)>>: Unpin,
Rc<dyn AnyValue>: Unpin,
impl UnsafeUnpin for ImageComparisonPropswhere
*const RcInner<VNodeInner> is !null: UnsafeUnpin,
PhantomData<RcInner<VNodeInner>>: UnsafeUnpin,
*const ArcInner<Error> is !null: UnsafeUnpin,
PhantomData<ArcInner<Error>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<f64, ()>>>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more