pub struct RateProps {Show 14 fields
pub value: Option<f64>,
pub default_value: Option<f64>,
pub count: usize,
pub allow_half: bool,
pub allow_clear: bool,
pub disabled: bool,
pub character: Option<Element>,
pub tooltips: Option<Vec<String>>,
pub class: Option<String>,
pub style: Option<String>,
pub on_change: Option<EventHandler<Option<f64>>>,
pub on_hover_change: Option<EventHandler<Option<f64>>>,
pub on_focus: Option<EventHandler<()>>,
pub on_blur: Option<EventHandler<()>>,
}Expand description
Rate component for collecting evaluations with stars (supports half).
Fields§
§value: Option<f64>Controlled numeric value.
default_value: Option<f64>Uncontrolled initial value.
count: usizeTotal count of items.
allow_half: boolAllow selecting half steps (0.5 increments).
allow_clear: boolAllow clearing when clicking the same value again.
disabled: boolDisable interactions.
character: Option<Element>Optional custom character for each item.
tooltips: Option<Vec<String>>Optional tooltips per item (aligned by index).
class: Option<String>§style: Option<String>§on_change: Option<EventHandler<Option<f64>>>Change callback (after click/keyboard). None means cleared.
on_hover_change: Option<EventHandler<Option<f64>>>Hover value callback.
on_focus: Option<EventHandler<()>>§on_blur: Option<EventHandler<()>>Implementations§
Source§impl RateProps
impl RateProps
Sourcepub fn builder() -> RatePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> RatePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building RateProps.
On the builder, call .value(...)(optional), .default_value(...)(optional), .count(...)(optional), .allow_half(...)(optional), .allow_clear(...)(optional), .disabled(...)(optional), .character(...)(optional), .tooltips(...)(optional), .class(...)(optional), .style(...)(optional), .on_change(...)(optional), .on_hover_change(...)(optional), .on_focus(...)(optional), .on_blur(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of RateProps.