pub struct CarouselProps {Show 17 fields
pub items: Vec<CarouselItem>,
pub slide_count: Option<usize>,
pub effect: CarouselEffect,
pub autoplay: bool,
pub autoplay_speed: u64,
pub dots: bool,
pub dot_placement: DotPlacement,
pub arrows: bool,
pub speed: u32,
pub initial_slide: usize,
pub infinite: bool,
pub pause_on_hover: bool,
pub on_change: Option<EventHandler<usize>>,
pub before_change: Option<EventHandler<(usize, usize)>>,
pub class: Option<String>,
pub style: Option<String>,
pub children: Element,
}Expand description
Props for the Carousel component.
Fields§
§items: Vec<CarouselItem>Slide items to display.
slide_count: Option<usize>Number of slides (used when using children instead of items).
effect: CarouselEffectTransition effect type.
autoplay: boolWhether to enable autoplay.
autoplay_speed: u64Autoplay interval in milliseconds.
dots: boolWhether to show navigation dots.
dot_placement: DotPlacementPosition of the navigation dots.
arrows: boolWhether to show arrow navigation.
speed: u32Transition speed in milliseconds.
initial_slide: usizeInitial slide index.
infinite: boolEnable infinite loop.
pause_on_hover: boolPause autoplay on hover.
on_change: Option<EventHandler<usize>>Callback when slide changes.
before_change: Option<EventHandler<(usize, usize)>>Callback before slide changes.
class: Option<String>Extra class for the root element.
style: Option<String>Inline style for the root element.
children: ElementSlide content (alternative to items prop, requires slide_count).
Implementations§
Source§impl CarouselProps
impl CarouselProps
Sourcepub fn builder() -> CarouselPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> CarouselPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building CarouselProps.
On the builder, call .items(...)(optional), .slide_count(...)(optional), .effect(...)(optional), .autoplay(...)(optional), .autoplay_speed(...)(optional), .dots(...)(optional), .dot_placement(...)(optional), .arrows(...)(optional), .speed(...)(optional), .initial_slide(...)(optional), .infinite(...)(optional), .pause_on_hover(...)(optional), .on_change(...)(optional), .before_change(...)(optional), .class(...)(optional), .style(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of CarouselProps.
Trait Implementations§
Source§impl Clone for CarouselProps
impl Clone for CarouselProps
Source§fn clone(&self) -> CarouselProps
fn clone(&self) -> CarouselProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more