A carousel/slideshow component for cycling through content items (images, cards, or custom content) with navigation and paging controls. RadzenCarousel displays one item at a time with automatic or manual advancement and various navigation options. Perfect for image galleries, product showcases, hero sections, or any content that benefits from sequential presentation. Features automatic advancement with configurable interval, Previous/Next buttons with customizable icons and text, dot indicators or page numbers for direct item selection, infinite loop for continuous cycling from last to first item, keyboard control (Arrow keys for navigation, Page Up/Down for first/last), swipe gestures on touch devices, and customization of button styles, pager position (top/bottom/overlay), and navigation visibility. Items are defined using RadzenCarouselItem components. Each item can contain images, text, or complex layouts. Use Auto property to enable automatic cycling, and Interval to control slide duration.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenCarousel : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRenderBasic image carousel:
<RadzenCarousel Style="height: 400px;">
<Items>
<RadzenCarouselItem>
<RadzenImage Path="images/slide1.jpg" Style="width: 100%; height: 100%; object-fit: cover;" />
</RadzenCarouselItem>
<RadzenCarouselItem>
<RadzenImage Path="images/slide2.jpg" Style="width: 100%; height: 100%; object-fit: cover;" />
</RadzenCarouselItem>
</Items>
</RadzenCarousel>
Auto-play carousel with custom navigation:
<RadzenCarousel Auto="true" Interval="3000" AllowNavigation="true" PagerPosition="PagerPosition.Bottom">
<Items>
<RadzenCarouselItem>Slide 1 content</RadzenCarouselItem>
<RadzenCarouselItem>Slide 2 content</RadzenCarouselItem>
<RadzenCarouselItem>Slide 3 content</RadzenCarouselItem>
</Items>
</RadzenCarousel>A carousel/slideshow component for cycling through content items (images, cards, or custom content) with navigation and paging controls. RadzenCarousel displays one item at a time with automatic or manual advancement and various navigation options. Perfect for image galleries, product showcases, hero sections, or any content that benefits from sequential presentation. Features automatic advancement with configurable interval, Previous/Next buttons with customizable icons and text, dot indicators or page numbers for direct item selection, infinite loop for continuous cycling from last to first item, keyboard control (Arrow keys for navigation, Page Up/Down for first/last), swipe gestures on touch devices, and customization of button styles, pager position (top/bottom/overlay), and navigation visibility. Items are defined using RadzenCarouselItem components. Each item can contain images, text, or complex layouts. Use Auto property to enable automatic cycling, and Interval to control slide duration.
public RadzenCarousel()Gets or sets a value indicating whether paging is allowed. Set to true by default.
public bool AllowPaging { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether paging is allowed. Set to true by default. |
Gets or sets the slide transition animation duration in milliseconds. When null (default), the browser's native smooth scroll is used. Use 0 for instant transitions with no animation, or a positive value for a custom duration.
public double? AnimationDuration { get; set; }
| Type | Description |
|---|---|
| double? | Gets or sets the slide transition animation duration in milliseconds. When null (default), the browser's native smooth scroll is used. Use 0 for instant transitions with no animation, or a positive value for a custom duration. |
Gets or sets a value indicating whether this RadzenCarousel cycle is automatic.
public bool Auto { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether this RadzenCarousel cycle is automatic. |
Gets or sets the color shade of the buttons.
public Shade ButtonShade { get; set; }
| Type | Description |
|---|---|
| Shade | Gets or sets the color shade of the buttons. |
Gets or sets the buttons size.
public ButtonSize ButtonSize { get; set; }
| Type | Description |
|---|---|
| ButtonSize | Gets or sets the buttons size. |
Gets or sets the buttons style
public ButtonStyle ButtonStyle { get; set; }
| Type | Description |
|---|---|
| ButtonStyle | Gets or sets the buttons style |
Gets or sets the design variant of the buttons.
public Variant ButtonVariant { get; set; }
| Type | Description |
|---|---|
| Variant | Gets or sets the design variant of the buttons. |
Gets or sets the change callback.
public EventCallback<int> Change { get; set; }
| Type | Description |
|---|---|
| EventCallback<int> | Gets or sets the change callback. |
Gets or sets the auto-cycle interval in milliseconds.
public double Interval { get; set; }
| Type | Description |
|---|---|
| double | Gets or sets the auto-cycle interval in milliseconds. |
Gets or sets the items.
public RenderFragment Items { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Gets or sets the items. |
Gets or sets the next button icon.
public string NextIcon { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the next button icon. |
Gets or sets the next button text.
public string NextText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the next button text. |
Gets or sets the pager button aria-label format. Use {0} for the 1-based slide index.
public string PagerButtonAriaLabelFormat { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the pager button aria-label format. Use {0} for the 1-based slide index. |
Gets or sets a value indicating whether pager overlays the carousel items. Set to true by default.
public bool PagerOverlay { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether pager overlays the carousel items. Set to true by default. |
Gets or sets the pager position. Set to PagerPosition.Bottom by default.
public PagerPosition PagerPosition { get; set; }
| Type | Description |
|---|---|
| PagerPosition | Gets or sets the pager position. Set to PagerPosition.Bottom by default. |
Gets or sets the previous button icon.
public string PrevIcon { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the previous button icon. |
Gets or sets the previous button text.
public string PrevText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the previous button text. |
Gets or sets the selected index.
public int SelectedIndex { get; set; }
| Type | Description |
|---|---|
| int | Gets or sets the selected index. |
Gets or sets the selected index changed callback.
public EventCallback<int> SelectedIndexChanged { get; set; }
| Type | Description |
|---|---|
| EventCallback<int> | Gets or sets the selected index changed callback. |
Adds the item.
public void AddItem(RadzenCarouselItem item)
| Type | Name | Description |
|---|---|---|
| RadzenCarouselItem | item | The item. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
protected override Task OnAfterRenderAsync(bool firstRender)
| Type | Name | Description |
|---|---|---|
| bool | firstRender |
| Type | Description |
|---|---|
| Task |
Removes the item.
public void RemoveItem(RadzenCarouselItem item)
| Type | Name | Description |
|---|---|---|
| RadzenCarouselItem | item | The item. |
Resets the auto-cycle timer.
public Task Reset()
| Type | Description |
|---|---|
| Task |
public override Task SetParametersAsync(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters |
| Type | Description |
|---|---|
| Task |