Carousel

An image carousel.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::carousel::*;

#[component]
pub fn CarouselAnatomy() -> impl IntoView {
    view! {
        <Carousel>
            <CarouselContent>
                <CarouselItem />
                <CarouselPrevious />
                <CarouselNext />
            </CarouselContent>
        </Carousel>
    }
}

API Reference

Carousel

Contains all the parts of a carousel.

Implements global attributes.

CarouselContent

Contains the content portion of the carousel.

Implements global attributes.

CarouselItem

Contains a single piece of content for the carousel.

Implements global and li attributes.

CarouselNext

A button that triggers the change to the next available carousel item.

Custom Attributes
NameTypeDefaultDescription
button_typeString"button"

Renamed <button> `type` attribute to avoid name collisions.

Implements global and button attributes.

CarouselPrevious

A button that triggers the change to the previous available carousel item.

Custom Attributes
NameTypeDefaultDescription
button_typeString"button"

Renamed <button> `type` attribute to avoid name collisions.

Implements global and button attributes.