Blazorise Carousel API
Explore the Blazorise Carousel API reference for parameters, events, methods, and related types.
For examples and usage guidance, see the Carousel documentation.
API
Parameters
Carousel
| Parameter | Default | Type |
|---|---|---|
Animated | true | bool |
Enables the transitions supplied by the CSS provider. Set to false for immediate changes. | ||
AnimationDuration | Provider default | int? |
Overrides the provider's animation duration, in milliseconds. Null preserves the provider's default. Zero or a negative value disables transitions. When omitted, uses the provider CSS transition duration. Animation is disabled when Animated is false. | ||
Autoplay | true | bool |
Determines whether playback starts automatically. | ||
AutoRepeat | true | bool |
Auto-repeats the carousel slides once they reach the end. | ||
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this Carousel. | ||
Crossfade | false | bool |
Animate slides with a fade transition instead of a slide. | ||
IndicatorTemplate | null | RenderFragment<CarouselIndicatorContext> |
Specifies a template for rendering carousel indicators. | ||
Interval | 2000 | double |
Specifies the interval (in milliseconds) after which the item will automatically slide. | ||
NextButtonLocalizer | null | TextLocalizerHandler |
Function used to handle custom localization for next button that will override a default ITextLocalizer. | ||
NextButtonTemplate | null | RenderFragment<CarouselNavigationContext> |
Specifies a template for rendering the next navigation button. | ||
PreviousButtonLocalizer | null | TextLocalizerHandler |
Function used to handle custom localization for previous button that will override a default ITextLocalizer. | ||
PreviousButtonTemplate | null | RenderFragment<CarouselNavigationContext> |
Specifies a template for rendering the previous navigation button. | ||
SelectedSlide | — | string |
Specifies the currently selected slide name. | ||
ShowControls | true | bool |
Specifies whether to show the controls that allows the user to navigate to the next or previous slide. | ||
ShowIndicators | true | bool |
Specifies whether to show an indicator for each slide. | ||
Swipeable | false | bool |
Specifies whether horizontal swipe gestures can navigate between slides. | ||
SwipePreventNativeDrag | true | bool |
Specifies whether native browser dragging is prevented while swipe gestures are active. | ||
SwipeThreshold | 50 | double |
Specifies the minimum swipe distance in pixels. | ||
SwipeTouchAction | PanY | GestureTouchAction |
Specifies the browser touch-action behavior applied while swipe gestures are active. Possible values: AutoNonePanXPanYManipulation | ||
SwipeVelocityThreshold | 0.3 | double |
Specifies the minimum swipe velocity in pixels per millisecond. | ||
CarouselSlide
| Parameter | Default | Type |
|---|---|---|
Caption | null | RenderFragment |
Specifies the caption content to be rendered inside this CarouselSlide. | ||
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this CarouselSlide. | ||
Interval | null | int? |
Specifies the interval (in milliseconds) after which this item will automatically slide. | ||
Name | — | string |
Specifies the slide name. | ||
Events
Carousel
| Event | Type |
|---|---|
SelectedSlideChanged | EventCallback<string> |
Occurs after the selected slide has changed. | |
Methods
Carousel
| Method | Return | Parameters |
|---|---|---|
SelectNext | Task | — |
Selects the next slide in a sequence, relative to the current slide.
| ||
SelectPrevious | Task | — |
Selects the previous slide in a sequence, relative to the current slide.
| ||
Select | Task | string name |
Selects the slide by its name.
| ||
SlideIndex | int | string slideName |
Gets the index of the slide with the specified name.
| ||
CarouselSlide
| Method | Return | Parameters |
|---|---|---|
Activate | Task | — |
Makes this slide active.
| ||