# Carousel **Also known as:** SlideShow ## Description Carousel (slideshow) lets users display their items across multiple slides. ## Parameters | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | AnimationDuration | `double` | 0.5 | Sets the duration of the scrolling animation in seconds (the default value is 0.5). | | AutoPlay | `bool` | false | Enables/disables the auto scrolling of the slides. | | AutoPlayInterval | `double` | 2000 | Sets the interval of the auto scrolling in milliseconds (the default value is 2000). | | ChildContent | `RenderFragment?` | null | Items of the carousel. | | Classes | `BitCarouselClassStyles?` | null | The custom CSS classes for the different parts of the carousel. | | GoLeftIcon | `BitIconInfo?` | null | Gets or sets the icon for the go to left button using custom CSS classes for external icon libraries. Takes precedence over GoLeftIconName when both are set. | | GoLeftIconName | `string?` | null | Gets or sets the name of the icon for the go to left button from the built-in Fluent UI icons. | | GoRightIcon | `BitIconInfo?` | null | Gets or sets the icon for the go to right button using custom CSS classes for external icon libraries. Takes precedence over GoRightIconName when both are set. | | GoRightIconName | `string?` | null | Gets or sets the name of the icon for the go to right button from the built-in Fluent UI icons. | | HideDots | `bool` | false | Hides the Dots indicator at the bottom of the BitCarousel. | | HideNextPrev | `bool` | false | Hides the Next/Prev buttons of the BitCarousel. | | InfiniteScrolling | `bool` | false | If enabled the carousel items will navigate in an infinite loop (first item comes after last item and last item comes before first item). | | OnChange | `EventCallback<int>` | | The event that will be called on carousel page navigation. | | ScrollItemsCount | `int` | 1 | Number of items that is going to be changed on navigation. | | Styles | `BitCarouselClassStyles?` | null | The custom CSS styles for the different parts of the carousel. | | VisibleItemsCount | `int` | 1 | Number of items that is visible in the carousel. | | AriaLabel | `string?` | null | Gets or sets the accessible label for the component, used by assistive technologies. | | Class | `string?` | null | Gets or sets the CSS class name(s) to apply to the rendered element. | | Dir | `BitDir?` | null | Gets or sets the text directionality for the component's content. | | ForceAnimation | `bool` | false | Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested. | | HtmlAttributes | `Dictionary<string, object>` | new Dictionary<string, object>() | Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. | | Id | `string?` | null | Gets or sets the unique identifier for the component's root element. | | IsEnabled | `bool` | true | Gets or sets a value indicating whether the component is enabled and can respond to user interaction. | | Style | `string?` | null | Gets or sets the CSS style string to apply to the rendered element. | | TabIndex | `string?` | null | Gets or sets the tab order index for the component when navigating with the keyboard. | | Visibility | `BitVisibility` | BitVisibility.Visible | Gets or sets the visibility state (visible, hidden, or collapsed) of the component. | ## Public Members | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | GoNext | `Task` | | Navigates to the next carousel item. | | GoPrev | `Task` | | Navigates to the previous carousel item. | | GoTo | `Task` | | Navigates to the given carousel item number. | | Pause | `Task` | | Pauses the AutoPlay if enabled. | | Resume | `Task` | | Resumes the AutoPlay if enabled. | | UniqueId | `Guid` | Guid.NewGuid() | Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed. | | RootElement | `ElementReference` | | Gets the reference to the root HTML element associated with this component. | ## Enums ### BitVisibility Enum | Name | Value | Description | | :--- | :--- | :---------- | | Visible | 0 | The content of the component is visible. | | Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). | | Collapsed | 2 | The component is hidden (display:none). | ### BitDir Enum | Name | Value | Description | | :--- | :--- | :---------- | | Ltr | 0 | Ltr (left to right) is to be used for languages that are written from the left to the right (like English). | | Rtl | 1 | Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic). | | Auto | 2 | Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element. | ## Sub Classes ### BitTimelineClassStyles Properties The custom CSS classes and styles of the different parts of the BitCarousel. | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | Root | `string?` | null | Custom CSS classes/styles for the root element of the BitCarousel. | | Container | `string?` | null | Custom CSS classes/styles for the container of the BitCarousel. | | Buttons | `string?` | null | Custom CSS classes/styles for the next/prev buttons of the BitCarousel. | | GoLeftButton | `string?` | null | Custom CSS classes/styles for the go to left button of the BitCarousel. | | GoLeftButtonIcon | `string?` | null | Custom CSS classes/styles for the icon of the go to left button of the BitCarousel. | | GoRightButton | `string?` | null | Custom CSS classes/styles for the go to right button of the BitCarousel. | | GoRightButtonIcon | `string?` | null | Custom CSS classes/styles for the icon of the go to right button of the BitCarousel. | | DotsContainer | `string?` | null | Custom CSS classes/styles for the dots container of the BitCarousel. | | Dots | `string?` | null | Custom CSS classes/styles for the dot elements of the BitCarousel. | | CurrectDot | `string?` | null | Custom CSS classes/styles for the current dot element of the BitCarousel. | ### BitIconInfo Properties | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | Name | `string?` | null | Gets or sets the name of the icon. | | BaseClass | `string?` | null | Gets or sets the base CSS class for the icon. For built-in Fluent UI icons, this defaults to "bit-icon". For external icon libraries like FontAwesome, you might set this to "fa" or leave empty. | | Prefix | `string?` | null | Gets or sets the CSS class prefix used before the icon name. For built-in Fluent UI icons, this defaults to "bit-icon--". For external icon libraries, you might set this to "fa-" or leave empty. | ## Examples \n**Basic**: ```razor
1 / 4
2 / 4
3 / 4
4 / 4
``` \n**InfiniteScrolling**: ```razor
Aurora
This is Aurora and it's fantastic
Beautiful Mountain
This is a Beautiful Mountain and it's gorgeous
Forest In The Valley
This is a Forest In The Valley and it's beautiful
Road Among The Mountains
This is a Road Among The Mountains and it's amazing
``` \n**HideDots**: ```razor
1 / 4
Aurora
This is Aurora and it's fantastic
2 / 4
Beautiful Mountain
This is a Beautiful Mountain and it's gorgeous
3 / 4
Forest In The Valley
This is a Forest In The Valley and it's beautiful
4 / 4
Road Among The Mountains
This is a Road Among The Mountains and it's amazing
``` \n**Public API**: ```razor
1 / 4
Aurora
This is Aurora and it's fantastic
2 / 4
Beautiful Mountain
This is a Beautiful Mountain and it's gorgeous
3 / 4
Forest In The Valley
This is a Forest In The Valley and it's beautiful
4 / 4
Road Among The Mountains
This is a Road Among The Mountains and it's amazing
< Prev Next > GoTo ``` ```csharp private int number = 1; private BitCarousel carousel; private async Task GoNext() { await carousel.GoNext(); } private async Task GoPrev() { await carousel.GoPrev(); } private async Task GoTo() { await carousel.GoTo(number); } ``` \n**AutoPlay**: ```razor
1 / 4
Aurora
This is Aurora and it's fantastic
2 / 4
Beautiful Mountain
This is a Beautiful Mountain and it's gorgeous
3 / 4
Forest In The Valley
This is a Forest In The Valley and it's beautiful
4 / 4
Road Among The Mountains
This is a Road Among The Mountains and it's amazing
``` \n**Advanced**: ```razor
1
2
3
4
5
6
7
8
9
``` \n**External Icons**: ```razor
FontAwesome (circle-arrow icons):
Aurora
This is Aurora and it's fantastic
Beautiful Mountain
This is a Beautiful Mountain and it's gorgeous
Forest In The Valley
This is a Forest In The Valley and it's beautiful
Road Among The Mountains
This is a Road Among The Mountains and it's amazing
Bootstrap Icons (arrow-left-circle / arrow-right-circle):
Aurora
This is Aurora and it's fantastic
Beautiful Mountain
This is a Beautiful Mountain and it's gorgeous
Forest In The Valley
This is a Forest In The Valley and it's beautiful
Road Among The Mountains
This is a Road Among The Mountains and it's amazing
``` \n**RTL**: ```razor
یک
دو
سه
چهار
پنج
شیش
هفت
هشت
نه
```