pub struct SliderProps {Show 38 fields
pub label: &'static str,
pub min: f64,
pub max: f64,
pub step: f64,
pub value: Option<f64>,
pub range: Option<(f64, f64)>,
pub double: bool,
pub orientation: Orientation,
pub size: Size,
pub color: Color,
pub cursor_style: Cursor,
pub show_value: bool,
pub show_steps: bool,
pub show_tooltip: bool,
pub disabled: bool,
pub on_change: Callback<f64>,
pub on_change_range: Callback<(f64, f64)>,
pub on_focus: Callback<()>,
pub on_blur: Callback<()>,
pub aria_label: Option<&'static str>,
pub aria_describedby: Option<&'static str>,
pub container_class: &'static str,
pub container_style: &'static str,
pub label_class: &'static str,
pub label_style: &'static str,
pub input_class: &'static str,
pub input_style: &'static str,
pub output_class: &'static str,
pub output_style: &'static str,
pub tooltip_style: &'static str,
pub steps_style: &'static str,
pub slider_width: Width,
pub slider_height: Height,
pub custom_thumb_css: Option<&'static str>,
pub custom_thumb_html: Option<Element>,
pub keyboard_step: f64,
pub icon_start: Option<Element>,
pub icon_end: Option<Element>,
}dio only.Expand description
Props for the Slider component.
These props configure the behavior, appearance, and accessibility of a slider input component supporting both single and double (range) sliders.
ยงFeatures
- Single or double slider modes.
- Vertical or horizontal orientation.
- Customizable appearance with CSS styles and classes.
- Tooltip, value display, and step indicators.
- Full accessibility support (ARIA attributes, keyboard steps).
Fieldsยง
ยงlabel: &'static strLabel text displayed above the slider.
min: f64Minimum value for the slider.
max: f64Maximum value for the slider.
step: f64Increment step size.
value: Option<f64>Current value for a single slider mode.
range: Option<(f64, f64)>Current range values (start, end) for double slider mode.
double: boolWhether to enable double slider mode (range selector).
orientation: OrientationSlider orientation: horizontal or vertical.
size: SizeSize variant for styling the slider track and thumb.
color: ColorColor variant for styling the slider.
cursor_style: CursorCursor style when hovering over the slider.
show_value: boolWhether to show the current value as an output.
show_steps: boolWhether to show step ticks along the slider track.
show_tooltip: boolWhether to show tooltip above the thumb on hover.
disabled: boolWhether to disable interaction with the slider.
on_change: Callback<f64>Callback triggered when the slider value changes.
on_change_range: Callback<(f64, f64)>Callback triggered when the slider range changes (double mode).
on_focus: Callback<()>Callback triggered when the slider gains focus.
on_blur: Callback<()>Callback triggered when the slider loses focus.
aria_label: Option<&'static str>ARIA label for accessibility.
aria_describedby: Option<&'static str>ARIA describedby attribute for accessibility.
container_class: &'static strCSS class for the container wrapping the slider.
container_style: &'static strInline style for the container wrapping the slider.
label_class: &'static strCSS class for the slider label.
label_style: &'static strInline style for the slider label.
input_class: &'static strCSS class for the slider input element.
input_style: &'static strInline style for the slider input element.
output_class: &'static strCSS class for the value/output display.
output_style: &'static strInline style for the value/output display.
tooltip_style: &'static strInline style for the tooltip element.
steps_style: &'static strInline style for the steps indicator below the slider track.
slider_width: WidthCustom width for the slider track.
slider_height: HeightCustom height for the slider track.
custom_thumb_css: Option<&'static str>Optional custom CSS for the slider thumb.
custom_thumb_html: Option<Element>Optional custom HTML content for the slider thumb.
keyboard_step: f64Keyboard step increment for arrow key adjustments.
icon_start: Option<Element>Optional icon element displayed before the slider.
icon_end: Option<Element>Optional icon element displayed after the slider.
Implementationsยง
Sourceยงimpl SliderProps
impl SliderProps
Sourcepub fn builder() -> SliderPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> SliderPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building SliderProps.
On the builder, call .label(...)(optional), .min(...)(optional), .max(...)(optional), .step(...)(optional), .value(...)(optional), .range(...)(optional), .double(...)(optional), .orientation(...)(optional), .size(...)(optional), .color(...)(optional), .cursor_style(...)(optional), .show_value(...)(optional), .show_steps(...)(optional), .show_tooltip(...)(optional), .disabled(...)(optional), .on_change(...)(optional), .on_change_range(...)(optional), .on_focus(...)(optional), .on_blur(...)(optional), .aria_label(...)(optional), .aria_describedby(...)(optional), .container_class(...)(optional), .container_style(...)(optional), .label_class(...)(optional), .label_style(...)(optional), .input_class(...)(optional), .input_style(...)(optional), .output_class(...)(optional), .output_style(...)(optional), .tooltip_style(...)(optional), .steps_style(...)(optional), .slider_width(...)(optional), .slider_height(...)(optional), .custom_thumb_css(...)(optional), .custom_thumb_html(...)(optional), .keyboard_step(...)(optional), .icon_start(...)(optional), .icon_end(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of SliderProps.
Trait Implementationsยง
Sourceยงimpl Clone for SliderProps
impl Clone for SliderProps
Sourceยงfn clone(&self) -> SliderProps
fn clone(&self) -> SliderProps
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSourceยงimpl PartialEq for SliderProps
impl PartialEq for SliderProps
Sourceยงimpl Properties for SliderPropswhere
Self: Clone,
impl Properties for SliderPropswhere
Self: Clone,
Sourceยงtype Builder = SliderPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = SliderPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
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 SliderProps
Auto Trait Implementationsยง
impl !Freeze for SliderProps
impl !RefUnwindSafe for SliderProps
impl !Send for SliderProps
impl !Sync for SliderProps
impl Unpin for SliderProps
impl !UnwindSafe for SliderProps
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,
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> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Sourceยงfn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.Sourceยงimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Sourceยงfn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.