Carousel
Description
A slideshow component for cycling through elements
Carousels allow users to cycle through a set of related content, such as images, features, or messages. They are effective for showcasing highlights in a limited space.
The component supports any Tesserae component as a slide and provides automatic or manual navigation.
API reference
public sealed class Carousel : ComponentBase<Carousel, HTMLElement>A horizontal carousel that cycles through a sequence of items (slides) one at a time, with arrows and pagination.
- Namespace
- Tesserae
- Inheritance
- ComponentBase<Carousel, HTMLElement> → Carousel
Constructors
| Name | Description |
|---|---|
| Carousel | Initializes a new instance of this class. |
Properties
| Name | Description |
|---|---|
| CurrentIndex | Gets or sets the current index. |
| SlideCount | Gets or sets the slide count. |
Methods
| Name | Description |
|---|---|
| AddSlide | Adds the given slide to the component. |
| AddSlides | Adds the given slides to the component. |
| OnSlideChange | Registers a callback invoked when the slide change event fires. |
| PadSlides | Configures the pad slides on the component. |
| SetIndex | Sets the index of the component. |
| Next | Configures the component to next. |
| Previous | Configures the component to previous. |
| Render | Renders the component's root HTML element. |
public Carousel AddSlide(IComponent content)Adds the given slide to the component.
public Carousel AddSlides(params IComponent[] slides)Adds the given slides to the component.
public Carousel OnSlideChange(Action<Carousel> onSlideChanged)Registers a callback invoked when the slide change event fires.
public Carousel SetIndex(int index, bool raiseEvent = true)Sets the index of the component.