DwsCarousel
DwsCarousel shows one slide at a time: images, any content, or slides generated from a collection. It supports arrows, indicators, swipe, keyboard navigation, auto-play and six transitions, and runs entirely in C# and CSS.
API Reference — DwsCarousel API Reference — DwsCarouselItem API Reference — DwsCarouselItemsImage slider
Images turns a list of URLs into slides. Swipe, the arrows, the indicators or the arrow keys (on a focused indicator) change slides.
Show Code
Carousel.razor
<DwsCarousel Name="CarouselDemo_Carousel01" Images="@_images" Height="320" />
@code {
private readonly string[] _images =
[
"https://images.unsplash.com/photo-1516117172878-fd2c41f4a759?w=1200&q=80",
"https://images.unsplash.com/photo-1498050108023-c5249f4df085?w=1200&q=80",
"https://images.unsplash.com/photo-1556740749-887f6717d7e4?w=1200&q=80",
];
}Captions over images
DwsCarouselItem with Src shows an image and uses its content as the caption.
Show Code
Carousel.razor
<DwsCarousel Name="CarouselDemo_Carousel02" Height="280">
<DwsCarouselItem Name="CarouselDemo_Carousel02_Item01" Src="@_images[0]" Alt="First photo" Title="Caption over an image">
<DwsTypography Name="CarouselDemo_Carousel02_Heading01" Typography="DwsTypographyType.Heading3">Caption over an image</DwsTypography>
<DwsTypography Name="CarouselDemo_Carousel02_Text01" Typography="DwsTypographyType.Paragraph" Class="mb-0">Set Src and the slide's content becomes its caption.</DwsTypography>
</DwsCarouselItem>
<DwsCarouselItem Name="CarouselDemo_Carousel02_Item04" Src="@_images[1]" Alt="Second photo" Title="A second caption">
<DwsTypography Name="CarouselDemo_Carousel02_Heading04" Typography="DwsTypographyType.Heading3">A second caption</DwsTypography>
</DwsCarouselItem>
</DwsCarousel>
@code {
private readonly string[] _images =
[
"https://images.unsplash.com/photo-1516117172878-fd2c41f4a759?w=1200&q=80",
"https://images.unsplash.com/photo-1498050108023-c5249f4df085?w=1200&q=80",
"https://images.unsplash.com/photo-1556740749-887f6717d7e4?w=1200&q=80",
];
}Content slides
Without Src a DwsCarouselItem renders its content as is, components included.
Show Code
Carousel.razor
<DwsCarousel Name="CarouselDemo_CarouselContent" Height="280">
<DwsCarouselItem Name="CarouselDemo_Carousel02_Item02" Title="Plain content">
<div class="h-100 d-flex flex-column justify-content-center align-items-center p-4" style="background: var(--primary); color: var(--primary-text);">
<DwsTypography Name="CarouselDemo_Carousel02_Heading02" Typography="DwsTypographyType.Heading3">Plain content</DwsTypography>
<DwsTypography Name="CarouselDemo_Carousel02_Text02" Typography="DwsTypographyType.Paragraph" Class="mb-0">Without Src the slide renders its content as is.</DwsTypography>
</div>
</DwsCarouselItem>
<DwsCarouselItem Name="CarouselDemo_Carousel02_Item03" Title="Components inside">
<div class="h-100 d-flex flex-column justify-content-center align-items-center gap-2 p-4" style="background: var(--secondary); color: var(--secondary-text);">
<DwsTypography Name="CarouselDemo_Carousel02_Heading03" Typography="DwsTypographyType.Heading3">Components inside</DwsTypography>
<DwsButton Name="CarouselDemo_Carousel02_Button01" StartIcon="@Icons.BS.HandThumbsUp">Slides can hold components</DwsButton>
</div>
</DwsCarouselItem>
</DwsCarousel>Appearance and border
Appearance, Color and the Border* parameters theme the carousel; Width and Height (and their Min/Max) size it in pixels.
Show Code
Carousel.razor
<DwsCarousel Name="CarouselDemo_Carousel08" Images="@_images" Width="360" Height="220"
Appearance="DwsAppearance.Outline" Color="DwsColor.Secondary" BorderWidth="2" BorderColor="DwsColor.Secondary" BorderRadius="12" />
@code {
private readonly string[] _images =
[
"https://images.unsplash.com/photo-1516117172878-fd2c41f4a759?w=1200&q=80",
"https://images.unsplash.com/photo-1498050108023-c5249f4df085?w=1200&q=80",
"https://images.unsplash.com/photo-1556740749-887f6717d7e4?w=1200&q=80",
];
}Image fit and background
ImageFit decides whether images are cropped (Cover) or letterboxed (Contain); BackgroundColor fills the space around a letterboxed image.
Show Code
Carousel.razor
<DwsCarousel Name="CarouselDemo_Carousel09" Images="@_images" Width="360" Height="220"
Appearance="DwsAppearance.Filled" BackgroundColor="DwsColor.Dark" Color="DwsColor.Warning" ImageFit="DwsImageFit.Contain" />
@code {
private readonly string[] _images =
[
"https://images.unsplash.com/photo-1516117172878-fd2c41f4a759?w=1200&q=80",
"https://images.unsplash.com/photo-1498050108023-c5249f4df085?w=1200&q=80",
"https://images.unsplash.com/photo-1556740749-887f6717d7e4?w=1200&q=80",
];
}Several slides per view
SlidesPerView shows that many slides side by side in a row that moves sideways; SlidesToScroll is the step and SlideGap the space between them. The active slide is the first one shown, and navigation stops when the last slide has reached the edge - there is one indicator per stop, not per slide. Slides outside the row are inert. The number is not responsive by itself: set a smaller value on narrow screens.
Show Code
Carousel.razor
@foreach (int perView in new[] { 1, 2, 3, 4 })
{
<DwsButton Name="@($"CarouselDemo_PerView_{perView}")" Appearance="@(perView == _slidesPerView ? DwsAppearance.Filled : DwsAppearance.Outline)"
OnClick="@(() => _slidesPerView = perView)">@perView per view</DwsButton>
}
<DwsSwitch Name="CarouselDemo_PerView_ScrollPage" @bind-Value="_scrollByPage" Label="Step by a whole row" />
<DwsCarousel Name="CarouselDemo_Carousel12" Height="180"
SlidesPerView="@_slidesPerView" SlidesToScroll="@(_scrollByPage ? _slidesPerView : 1)" SlideGap="12"
OverlayControls="false" @bind-SelectedIndex="_multiIndex">
@foreach (int number in Enumerable.Range(1, 7))
{
<DwsCarouselItem Name="@($"CarouselDemo_Carousel12_Item{number}")" Title="@($"Card {number}")">
<div class="h-100 d-flex flex-column justify-content-center align-items-center p-3" style="background: var(--surface); border: 1px solid var(--outline); border-radius: var(--border-radius);">
<DwsTypography Name="@($"CarouselDemo_Carousel12_Heading{number}")" Typography="DwsTypographyType.Heading3" Class="mb-1">Card @number</DwsTypography>
<DwsButton Name="@($"CarouselDemo_Carousel12_Button{number}")" Appearance="DwsAppearance.Outline">Open</DwsButton>
</div>
</DwsCarouselItem>
}
</DwsCarousel>
<div role="status"><DwsTypography Name="CarouselDemo_Text_MultiIndex" Typography="DwsTypographyType.Paragraph" Class="mt-2 mb-0">First slide shown: @(_multiIndex + 1) of 7</DwsTypography></div>
@code {
private int _slidesPerView = 3;
private bool _scrollByPage;
private int _multiIndex;
}Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| Items | IReadOnlyList<DwsCarouselItem> | [] | All registered slides in order, including hidden and disabled ones. |
| ActiveItem | DwsCarouselItem? | null | The slide being shown. |
| CurrentIndex | int | -1 | Index of ActiveItem in Items, or -1. |
| AvailableCount | int | 0 | Number of slides navigation can stop on (visible and enabled). |
| IsAutoPlaying | bool | false | Whether auto-play is on (it may be paused by hover or focus). |
| IsTransitioning | bool | false | Whether a transition is running. |
| CanGoPrevious | bool | false | Whether PreviousAsync would move. |
| CanGoNext | bool | false | Whether NextAsync would move. |
| IsMultiView | bool | false | Whether more than one slide is shown at a time (SlidesPerView above 1). |
| StopCount | int | 0 | How many positions navigation can stop on: AvailableCount, or AvailableCount - SlidesPerView + 1 with several slides per view. |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| NextAsync | Task<bool> | Moves to the next available slide, wrapping when Loop is on. Returns whether the slide changed. | |
| PreviousAsync | Task<bool> | Moves to the previous available slide, wrapping when Loop is on. | |
| GoToFirstAsync | Task<bool> | Moves to the first available slide. | |
| GoToLastAsync | Task<bool> | Moves to the last available slide. | |
| GoToAsync | Task<bool> | int index | Moves to the slide at an index in Items. |
| GoToAsync | Task<bool> | string name | Moves to the slide with the given Name. |
| GoToAsync | Task<bool> | DwsCarouselItem item | Moves to the given slide. |
| StartAutoPlayAsync | Task | Switches auto-play on. | |
| StopAutoPlayAsync | Task | Switches auto-play off; the current slide stays. | |
| ToggleAutoPlayAsync | Task | Switches auto-play on or off. |
| Name | Typ | Default | Description |
|---|---|---|---|
| ChildContent | RenderFragment? | null | The slides: DwsCarouselItem and/or DwsCarouselItems components. |
| Images | IEnumerable<string>? | null | Image URLs, each shown as a slide ahead of ChildContent. |
| SelectedIndex | int | 0 | Index of the active slide. Bindable with @bind-SelectedIndex. |
| AllowNavigation | bool | true | Whether the user may change slides. When false the carousel is read-only and only moves through code, SelectedIndex and auto-play. |
| Loop | bool | true | Wraps from the last slide to the first and back; auto-play repeats. |
| EnableSwipe | bool | true | Changes slides on a horizontal swipe (touch, pen or mouse drag). |
| SwipeThreshold | int | 50 | Minimum swipe distance in pixels. |
| EnableKeyboardNavigation | bool | true | Arrow keys, Home and End change slides while an indicator has focus. |
| AutoPlay | bool | false | Advances slides automatically. Bindable with @bind-AutoPlay; the play/pause button updates it. |
| Interval | int | 5000 | Milliseconds auto-play stays on each slide. A slide can override it. |
| PauseOnHover | bool | true | Pauses auto-play while the pointer is over the carousel or focus is inside it. |
| PauseOnReducedMotion | bool | true | Auto-play starts paused for a user who asked the system for reduced motion (prefers-reduced-motion: reduce). The play button stays, so the slide show can still be started. |
| ShowAutoPlayToggle | bool | true | Shows a play/pause button once auto-play has been on. |
| ShowArrows | bool | true | Shows the previous/next arrows. |
| ArrowsVisibility | DwsCarouselControlVisibility | Always | Always, or OnHover to show the arrows only on hover/focus (always on touch screens). |
| PreviousIcon | string | Icons.BS.ChevronLeft | Icon of the built-in previous button. |
| NextIcon | string | Icons.BS.ChevronRight | Icon of the built-in next button. |
| PreviousButtonTemplate | RenderFragment<DwsCarousel>? | null | Replaces the built-in previous button; the context is the carousel. |
| NextButtonTemplate | RenderFragment<DwsCarousel>? | null | Replaces the built-in next button; the context is the carousel. |
| SlidesPerView | int | 1 | How many slides are shown side by side. Above 1 the slides form a row that moves sideways; the active slide is the first one shown. |
| SlidesToScroll | int | 1 | How many slides one step moves by while SlidesPerView is above 1. |
| SlideGap | int? | null | Space between slides while SlidesPerView is above 1, in pixels. |
| ShowThumbnails | bool | false | Shows a strip of thumbnails instead of the indicator bullets, beside the slides on the IndicatorPosition side. Each thumbnail is a lazily loaded DwsImage. |
| ThumbnailWidth | int | 72 | A thumbnail's width in pixels. |
| ThumbnailHeight | int | 48 | A thumbnail's height in pixels. |
| ShowIndicators | bool | true | Shows one indicator per slide (per stop while SlidesPerView is above 1). |
| IndicatorsVisibility | DwsCarouselControlVisibility | Always | Always, or OnHover to show the indicators only on hover/focus (always on touch screens). |
| IndicatorPosition | DwsCarouselIndicatorPosition | Bottom | Bottom, Top, Left or Right. |
| IndicatorTemplate | RenderFragment<DwsCarouselIndicatorContext>? | null | Replaces the bullet inside each indicator. The context has Item, Index, Position, Count and IsActive. |
| OverlayControls | bool | true | Lays arrows and indicators over the slides; false places them around the slides. |
| Haptic | DwsHapticFeedback | Selection | Touch feedback (when haptics are switched on) of a tap on an arrow or an indicator. None switches it off; nothing plays while the carousel is disabled or AllowNavigation is off. |
| AnimationMode | DwsCarouselAnimationMode | Slide | None, Fade, Slide, SlideFromTop, Bounce or Rotate. A slide can override it. Suppressed under prefers-reduced-motion. |
| AnimationSpeed | DwsAnimationSpeed | Slow | Transition length: Instant, Fast, Normal or Slow. |
| AnimationDuration | int? | null | Transition length in milliseconds; overrides AnimationSpeed. |
| Appearance | DwsAppearance | Flat | Filled (surface background), Outline (border) or Flat. |
| Color | DwsColor | Undefined | Accent color of arrows, indicators and play/pause button; Primary when undefined. |
| BackgroundColor | DwsColor | Undefined | Background color. |
| BorderWidth | int? | null | Border width in pixels. A border is drawn when set, or with Appearance Outline. |
| BorderStyle | DwsBorderStyle | Solid | Border style. |
| BorderColor | DwsColor | Undefined | Border color; the theme outline color when undefined. |
| BorderRadius | int? | null | Corner radius in pixels. |
| ImageFit | DwsImageFit | Cover | How images fill their slide: Cover crops, Contain letterboxes. A slide can override it. |
| AriaLabel | string? | null | Accessible name of the carousel; a localized "Carousel" when null. |
| Width | int? | null | Width in pixels; 100% when null. |
| MinWidth | int? | null | Minimum width in pixels. |
| MaxWidth | int? | null | Maximum width in pixels. |
| Height | int? | null | Height in pixels; the tallest slide's height when null. |
| MinHeight | int? | null | Minimum height in pixels. |
| MaxHeight | int? | null | Maximum height in pixels. |
| Stretch | bool | false | Fills the parent's width and height, overriding Width and Height. |
| Name | Typ | Description |
|---|---|---|
| SelectedIndexChanged | EventCallback<int> | Raised when the active slide changes; backs @bind-SelectedIndex. |
| AutoPlayChanged | EventCallback<bool> | Raised when auto-play is switched on or off from inside the carousel; backs @bind-AutoPlay. |
| OnSlideChanging | EventCallback<DwsCarouselSlideChangingEventArgs> | Raised before the slide changes, with PreviousIndex, NextIndex, Forward and Trigger. Set Cancel to stay. |
| OnSlideChanged | EventCallback<DwsCarouselSlideChangedEventArgs> | Raised when the slide has changed, as its transition starts. |
| OnTransitionEnd | EventCallback<DwsCarouselSlideChangedEventArgs> | Raised when a transition has finished; not for one cut short by the next. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the component's root element. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| ChildContent | RenderFragment? | null | The slide's content, or its caption when Src is set. |
| Src | string? | null | An image that fills the slide. |
| Alt | string? | null | The image's alternative text. |
| ImageFit | DwsImageFit? | null | Overrides the carousel's ImageFit for this slide. |
| Title | string? | null | Accessible name and indicator tooltip; "Slide x of y" when null. |
| ThumbnailSrc | string? | null | The image shown in the carousel's thumbnail strip; Src when null, the slide's number when there is neither. |
| AnimationMode | DwsCarouselAnimationMode? | null | Overrides the carousel's AnimationMode for transitions into this slide. |
| Interval | int? | null | Overrides the carousel's Interval for this slide, in milliseconds. |
| Source | object? | null | Set by DwsCarouselItems only: the collection that generated this slide. |
| SourceOrder | int | 0 | Set by DwsCarouselItems only: the slide's position in that collection. |
| Name | Typ | Description |
|---|---|---|
| OnShow | EventCallback | Raised when this slide becomes active. |
| OnHide | EventCallback | Raised when this slide stops being active. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the component's root element. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| Items | IEnumerable<TItem>? | null | The items to generate slides for. |
| ItemTemplate | RenderFragment<TItem>? | null | A slide's content, or its caption when ImageSelector returns an image. |
| ImageSelector | Func<TItem, string?>? | null | Returns the image that fills an item's slide. |
| ThumbnailSelector | Func<TItem, string?>? | null | Returns the image for an item's thumbnail; the slide's image when null. |
| AltSelector | Func<TItem, string?>? | null | Returns an item's image alternative text. |
| TitleSelector | Func<TItem, string?>? | null | Returns an item's slide title. |
| AnimationModeSelector | Func<TItem, DwsCarouselAnimationMode?>? | null | Returns the transition into an item's slide. |
| IntervalSelector | Func<TItem, int?>? | null | Returns how long auto-play stays on an item's slide. |
| KeySelector | Func<TItem, object?>? | null | Returns a stable key per item; the item itself when null. |
| NameSelector | Func<TItem, string>? | null | Returns a slide's Name; "{Name}_Item{index}" when null. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the component's root element. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
