Lists
BasicList
BitBasicList renders items into a scrolling region, one RowTemplate per item, and stays agnostic of the row's layout and of selection. Items come from a collection or from an ItemsProvider called for a region at a time; Virtualize keeps only the visible rows in the DOM, while LoadMore pages through the set by a button or, with AutoLoad, by scrolling.
Usage
Every example is live. Open its code to see exactly what produced the component running underneath.
Basic
role="listitem" so the default list role is announced with its count.
Empty content
Nobody to show here yet.
Header & Footer
position: sticky to keep it in view.
Loading
Virtualization
ItemsProvider
Grouped ItemsProvider
LoadMore
AutoLoad
Layout
Scrolling & refreshing
Accessibility
role="list" (Role; null removes it), the AriaLabel and aria-busy while a page loads;
the header, footer and LoadMore button sit beside it, since a list may only own list items.
Where that element has no role to name (while empty or loading, or with a null Role) the AriaLabel names the scrolling root, as a group, instead.
A list whose rows hold nothing focusable needs TabIndex 0 on its scrolling root so it can be scrolled from the keyboard (WCAG 2.1.1).
A page being loaded is announced with LoadingLabel, and when the last page removes the focused LoadMore button the focus moves to the list instead of being lost.
Cascading parameters
Style & Class
:root, an ancestor or a single list's Style.
RTL
شناسه: 1
نام کامل: شخص 1 نام خانواگی شخص 1
شغل: برنامه نویس 1
شناسه: 2
نام کامل: شخص 2 نام خانواگی شخص 2
شغل: برنامه نویس 2
شناسه: 3
نام کامل: شخص 3 نام خانواگی شخص 3
شغل: برنامه نویس 3
شناسه: 4
نام کامل: شخص 4 نام خانواگی شخص 4
شغل: برنامه نویس 4
شناسه: 5
نام کامل: شخص 5 نام خانواگی شخص 5
شغل: برنامه نویس 5
شناسه: 6
نام کامل: شخص 6 نام خانواگی شخص 6
شغل: برنامه نویس 6
شناسه: 7
نام کامل: شخص 7 نام خانواگی شخص 7
شغل: برنامه نویس 7
شناسه: 8
نام کامل: شخص 8 نام خانواگی شخص 8
شغل: برنامه نویس 8
شناسه: 9
نام کامل: شخص 9 نام خانواگی شخص 9
شغل: برنامه نویس 9
شناسه: 10
نام کامل: شخص 10 نام خانواگی شخص 10
شغل: برنامه نویس 10
شناسه: 11
نام کامل: شخص 11 نام خانواگی شخص 11
شغل: برنامه نویس 11
شناسه: 12
نام کامل: شخص 12 نام خانواگی شخص 12
شغل: برنامه نویس 12
شناسه: 13
نام کامل: شخص 13 نام خانواگی شخص 13
شغل: برنامه نویس 13
شناسه: 14
نام کامل: شخص 14 نام خانواگی شخص 14
شغل: برنامه نویس 14
شناسه: 15
نام کامل: شخص 15 نام خانواگی شخص 15
شغل: برنامه نویس 15
شناسه: 16
نام کامل: شخص 16 نام خانواگی شخص 16
شغل: برنامه نویس 16
شناسه: 17
نام کامل: شخص 17 نام خانواگی شخص 17
شغل: برنامه نویس 17
شناسه: 18
نام کامل: شخص 18 نام خانواگی شخص 18
شغل: برنامه نویس 18
شناسه: 19
نام کامل: شخص 19 نام خانواگی شخص 19
شغل: برنامه نویس 19
شناسه: 20
نام کامل: شخص 20 نام خانواگی شخص 20
شغل: برنامه نویس 20
شناسه: 21
نام کامل: شخص 21 نام خانواگی شخص 21
شغل: برنامه نویس 21
شناسه: 22
نام کامل: شخص 22 نام خانواگی شخص 22
شغل: برنامه نویس 22
شناسه: 23
نام کامل: شخص 23 نام خانواگی شخص 23
شغل: برنامه نویس 23
شناسه: 24
نام کامل: شخص 24 نام خانواگی شخص 24
شغل: برنامه نویس 24
شناسه: 25
نام کامل: شخص 25 نام خانواگی شخص 25
شغل: برنامه نویس 25
شناسه: 26
نام کامل: شخص 26 نام خانواگی شخص 26
شغل: برنامه نویس 26
شناسه: 27
نام کامل: شخص 27 نام خانواگی شخص 27
شغل: برنامه نویس 27
شناسه: 28
نام کامل: شخص 28 نام خانواگی شخص 28
شغل: برنامه نویس 28
شناسه: 29
نام کامل: شخص 29 نام خانواگی شخص 29
شغل: برنامه نویس 29
شناسه: 30
نام کامل: شخص 30 نام خانواگی شخص 30
شغل: برنامه نویس 30
شناسه: 31
نام کامل: شخص 31 نام خانواگی شخص 31
شغل: برنامه نویس 31
شناسه: 32
نام کامل: شخص 32 نام خانواگی شخص 32
شغل: برنامه نویس 32
شناسه: 33
نام کامل: شخص 33 نام خانواگی شخص 33
شغل: برنامه نویس 33
شناسه: 34
نام کامل: شخص 34 نام خانواگی شخص 34
شغل: برنامه نویس 34
شناسه: 35
نام کامل: شخص 35 نام خانواگی شخص 35
شغل: برنامه نویس 35
شناسه: 36
نام کامل: شخص 36 نام خانواگی شخص 36
شغل: برنامه نویس 36
شناسه: 37
نام کامل: شخص 37 نام خانواگی شخص 37
شغل: برنامه نویس 37
شناسه: 38
نام کامل: شخص 38 نام خانواگی شخص 38
شغل: برنامه نویس 38
شناسه: 39
نام کامل: شخص 39 نام خانواگی شخص 39
شغل: برنامه نویس 39
شناسه: 40
نام کامل: شخص 40 نام خانواگی شخص 40
شغل: برنامه نویس 40
شناسه: 41
نام کامل: شخص 41 نام خانواگی شخص 41
شغل: برنامه نویس 41
شناسه: 42
نام کامل: شخص 42 نام خانواگی شخص 42
شغل: برنامه نویس 42
شناسه: 43
نام کامل: شخص 43 نام خانواگی شخص 43
شغل: برنامه نویس 43
شناسه: 44
نام کامل: شخص 44 نام خانواگی شخص 44
شغل: برنامه نویس 44
شناسه: 45
نام کامل: شخص 45 نام خانواگی شخص 45
شغل: برنامه نویس 45
شناسه: 46
نام کامل: شخص 46 نام خانواگی شخص 46
شغل: برنامه نویس 46
شناسه: 47
نام کامل: شخص 47 نام خانواگی شخص 47
شغل: برنامه نویس 47
شناسه: 48
نام کامل: شخص 48 نام خانواگی شخص 48
شغل: برنامه نویس 48
شناسه: 49
نام کامل: شخص 49 نام خانواگی شخص 49
شغل: برنامه نویس 49
شناسه: 50
نام کامل: شخص 50 نام خانواگی شخص 50
شغل: برنامه نویس 50
شناسه: 51
نام کامل: شخص 51 نام خانواگی شخص 51
شغل: برنامه نویس 51
شناسه: 52
نام کامل: شخص 52 نام خانواگی شخص 52
شغل: برنامه نویس 52
شناسه: 53
نام کامل: شخص 53 نام خانواگی شخص 53
شغل: برنامه نویس 53
شناسه: 54
نام کامل: شخص 54 نام خانواگی شخص 54
شغل: برنامه نویس 54
شناسه: 55
نام کامل: شخص 55 نام خانواگی شخص 55
شغل: برنامه نویس 55
شناسه: 56
نام کامل: شخص 56 نام خانواگی شخص 56
شغل: برنامه نویس 56
شناسه: 57
نام کامل: شخص 57 نام خانواگی شخص 57
شغل: برنامه نویس 57
شناسه: 58
نام کامل: شخص 58 نام خانواگی شخص 58
شغل: برنامه نویس 58
شناسه: 59
نام کامل: شخص 59 نام خانواگی شخص 59
شغل: برنامه نویس 59
شناسه: 60
نام کامل: شخص 60 نام خانواگی شخص 60
شغل: برنامه نویس 60
شناسه: 61
نام کامل: شخص 61 نام خانواگی شخص 61
شغل: برنامه نویس 61
شناسه: 62
نام کامل: شخص 62 نام خانواگی شخص 62
شغل: برنامه نویس 62
شناسه: 63
نام کامل: شخص 63 نام خانواگی شخص 63
شغل: برنامه نویس 63
شناسه: 64
نام کامل: شخص 64 نام خانواگی شخص 64
شغل: برنامه نویس 64
شناسه: 65
نام کامل: شخص 65 نام خانواگی شخص 65
شغل: برنامه نویس 65
شناسه: 66
نام کامل: شخص 66 نام خانواگی شخص 66
شغل: برنامه نویس 66
شناسه: 67
نام کامل: شخص 67 نام خانواگی شخص 67
شغل: برنامه نویس 67
شناسه: 68
نام کامل: شخص 68 نام خانواگی شخص 68
شغل: برنامه نویس 68
شناسه: 69
نام کامل: شخص 69 نام خانواگی شخص 69
شغل: برنامه نویس 69
شناسه: 70
نام کامل: شخص 70 نام خانواگی شخص 70
شغل: برنامه نویس 70
شناسه: 71
نام کامل: شخص 71 نام خانواگی شخص 71
شغل: برنامه نویس 71
شناسه: 72
نام کامل: شخص 72 نام خانواگی شخص 72
شغل: برنامه نویس 72
شناسه: 73
نام کامل: شخص 73 نام خانواگی شخص 73
شغل: برنامه نویس 73
شناسه: 74
نام کامل: شخص 74 نام خانواگی شخص 74
شغل: برنامه نویس 74
شناسه: 75
نام کامل: شخص 75 نام خانواگی شخص 75
شغل: برنامه نویس 75
شناسه: 76
نام کامل: شخص 76 نام خانواگی شخص 76
شغل: برنامه نویس 76
شناسه: 77
نام کامل: شخص 77 نام خانواگی شخص 77
شغل: برنامه نویس 77
شناسه: 78
نام کامل: شخص 78 نام خانواگی شخص 78
شغل: برنامه نویس 78
شناسه: 79
نام کامل: شخص 79 نام خانواگی شخص 79
شغل: برنامه نویس 79
شناسه: 80
نام کامل: شخص 80 نام خانواگی شخص 80
شغل: برنامه نویس 80
شناسه: 81
نام کامل: شخص 81 نام خانواگی شخص 81
شغل: برنامه نویس 81
شناسه: 82
نام کامل: شخص 82 نام خانواگی شخص 82
شغل: برنامه نویس 82
شناسه: 83
نام کامل: شخص 83 نام خانواگی شخص 83
شغل: برنامه نویس 83
شناسه: 84
نام کامل: شخص 84 نام خانواگی شخص 84
شغل: برنامه نویس 84
شناسه: 85
نام کامل: شخص 85 نام خانواگی شخص 85
شغل: برنامه نویس 85
شناسه: 86
نام کامل: شخص 86 نام خانواگی شخص 86
شغل: برنامه نویس 86
شناسه: 87
نام کامل: شخص 87 نام خانواگی شخص 87
شغل: برنامه نویس 87
شناسه: 88
نام کامل: شخص 88 نام خانواگی شخص 88
شغل: برنامه نویس 88
شناسه: 89
نام کامل: شخص 89 نام خانواگی شخص 89
شغل: برنامه نویس 89
شناسه: 90
نام کامل: شخص 90 نام خانواگی شخص 90
شغل: برنامه نویس 90
شناسه: 91
نام کامل: شخص 91 نام خانواگی شخص 91
شغل: برنامه نویس 91
شناسه: 92
نام کامل: شخص 92 نام خانواگی شخص 92
شغل: برنامه نویس 92
شناسه: 93
نام کامل: شخص 93 نام خانواگی شخص 93
شغل: برنامه نویس 93
شناسه: 94
نام کامل: شخص 94 نام خانواگی شخص 94
شغل: برنامه نویس 94
شناسه: 95
نام کامل: شخص 95 نام خانواگی شخص 95
شغل: برنامه نویس 95
شناسه: 96
نام کامل: شخص 96 نام خانواگی شخص 96
شغل: برنامه نویس 96
شناسه: 97
نام کامل: شخص 97 نام خانواگی شخص 97
شغل: برنامه نویس 97
شناسه: 98
نام کامل: شخص 98 نام خانواگی شخص 98
شغل: برنامه نویس 98
شناسه: 99
نام کامل: شخص 99 نام خانواگی شخص 99
شغل: برنامه نویس 99
شناسه: 100
نام کامل: شخص 100 نام خانواگی شخص 100
شغل: برنامه نویس 100
CSS variables
The public custom properties this component reads off its root, for what no parameter covers.
Every variable is read with a fallback and never declared by the component, so it inherits like any other custom property:
set one on :root (or in a [bit-theme] block) to restyle every instance, on any ancestor to restyle the ones inside it,
or on the Style of one instance to restyle that one alone. Leave a variable unset and the component falls back to the theme token beside it.
BitBasicList CSS variables
| Name | Default value | Description |
|---|---|---|
| --bit-BasicList-height | 31.25rem (spacing(62.5)) | Height of a vertical list. A Horizontal list is as tall as its rows. |
| --bit-BasicList-focus-color | --bit-clr-pri-focus | Focus ring of the list (when it is focusable) and of its LoadMore element. |
| --bit-BasicList-disabled-color | --bit-clr-fg-dis | Text of the default LoadMore button when Disabled is true. |
| --bit-BasicList-loading-padding | spacing(2) | Padding of the loading content. |
| --bit-BasicList-loading-color | --bit-clr-fg-sec | Text of the default loading content. |
| --bit-BasicList-spinner-color | --bit-clr-pri | Moving arc of the default spinners (loading content and busy LoadMore button). |
| --bit-BasicList-spinner-size | --bit-siz-icon-md | Width and height of the default spinners. |
| --bit-BasicList-load-more-padding | spacing(2) | Padding of the default LoadMore button. |
| --bit-BasicList-load-more-color | --bit-clr-pri | Text of the default LoadMore button at rest. |
| --bit-BasicList-load-more-hover-color | --bit-clr-pri-hover | Text of the default LoadMore button on hover (pointer devices only). |
| --bit-BasicList-load-more-background | transparent | Background of the default LoadMore button at rest, while busy and when disabled. |
| --bit-BasicList-load-more-hover-background | --bit-clr-bg-pri-hover | Background of the default LoadMore button on hover (pointer devices only). |
| --bit-BasicList-load-more-active-background | The hover background, else --bit-clr-bg-pri-active | Background of the default LoadMore button while pressed. |
| --bit-BasicList-load-more-font-size | inherit | Text size of the default LoadMore button. |
| --bit-BasicList-load-more-font-weight | --bit-tpg-fw-semibold | Text weight of the default LoadMore button. |
API
Every parameter, public member, sub-class and enum this component exposes.
BitBasicList parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| AutoLoad | bool | false | Loads the next page as soon as the end of the loaded items scrolls into view, turning the LoadMore button into an infinite scrolling list. Only effective while LoadMore is enabled. |
| AutoLoadThreshold | int | 0 | How many pixels before the end of the loaded items the next page starts loading in AutoLoad mode. |
| Classes | BitBasicListClassStyles? | null | Custom CSS classes for different parts of the list. |
| EmptyContent | RenderFragment? | null | The content rendered in place of the rows while the list holds no items. |
| FitHeight | bool | false | Sets the height of the list to fit its content. |
| FitSize | bool | false | Sets the width and height of the list to fit its content. |
| FitWidth | bool | false | Sets the width of the list to fit its content. |
| FooterTemplate | RenderFragment? | null | The content rendered below the items of the list, inside its scrolling region. |
| FullHeight | bool | false | Sets the height of the list to 100%. |
| FullSize | bool | false | Sets the width and height of the list to 100%. |
| FullWidth | bool | false | Sets the width of the list to 100%. |
| HeaderTemplate | RenderFragment? | null | The content rendered above the items of the list, inside its scrolling region. |
| Horizontal | bool | false | Lays the items of the list out in a row and scrolls it sideways instead of down. Ignored while Virtualize is enabled, since virtualization is vertical only. |
| Items | ICollection<TItem>? | null | The list of items to render. |
| ItemSize | float | 50 | Size of each item in pixels, used by the Virtualize mode to calculate the scroll range and the number of rows to render. |
| ItemsProvider | BitBasicListItemsProvider<TItem>? | null | The function providing items to the list. It always takes priority over Items, and is called for a region at a time in Virtualize mode, for a page at a time in LoadMore mode, and once for the whole set otherwise. |
| ItemsProviderDelay | int | 100 | The number of milliseconds the list waits before calling the ItemsProvider in Virtualize mode, which debounces the requests a scroll issues. A value of 0 turns the debouncing off. Never applies to the pages of the LoadMore mode. |
| Loading | bool | false | Shows the loading content in place of the rows. The list also raises this state on its own while it fetches the first page or a plain ItemsProvider set. |
| LoadingLabel | string? | Loading... | The text next to the spinner of the default loading content and of the default LoadMore button while a page loads; announced to screen readers as the list starts loading (a LoadingTemplate is announced with its own text). |
| LoadingTemplate | RenderFragment? | null | The template rendered while the list is loading its items. |
| LoadMore | bool | false | Enables the LoadMore mode for the list. |
| LoadMoreSize | int | 20 | The number of items to be loaded and rendered after the LoadMore button is clicked. |
| LoadMoreTemplate | RenderFragment<bool>? | null | Replaces the default LoadMore button. Its context is whether a page is being loaded at that moment. |
| LoadMoreText | string? | Load more | The custom text of the default LoadMore button. |
| OnLoadingChange | EventCallback<bool> | The callback that is invoked when the list starts and stops loading its items. | |
| OnLoadMore | EventCallback<int> | The callback that is invoked after each page of the LoadMore mode has been appended, with the number of items the list holds at that point. | |
| OverscanCount | int | 3 | A value that determines how many additional items will be rendered before and after the visible region in Virtualize mode. |
| Role | string? | list | The role of the element holding the rows (which also carries the AriaLabel). Without a RowTemplate each row is rendered as a listitem while the role is list. Left off while the EmptyContent shows; set it to null to leave it off altogether. Wherever the element has no role to name, the AriaLabel names the root, as a group, instead. |
| RowTemplate | RenderFragment<TItem>? | null | The template to render each row. Without it each item is rendered as its own text. |
| Styles | BitBasicListClassStyles? | null | Custom CSS styles for different parts of the list. |
| Virtualize | bool | false | Renders only the rows around the visible region. Vertical only. |
| VirtualizePlaceholder | RenderFragment<PlaceholderContext>? | null | The template of the rows whose items the ItemsProvider has not delivered yet in Virtualize mode. |
BitBasicList public members
| Name | Type | Default value | Description |
|---|---|---|---|
| LoadMoreAsync | Task | Loads the next page of the LoadMore mode, the same way clicking the LoadMore button does. | |
| RefreshDataAsync | Task | Reloads the items of the list: a LoadMore list starts over from its first page, a virtualized provider list re-requests the region it shows, a plain provider list fetches the whole set again, and a plain list picks up the current contents of its Items collection. | |
| ScrollToEndAsync | Task | Scrolls the list to its end. Pass true to animate the scrolling. | |
| ScrollToIndexAsync | Task | Scrolls the list so that the item at the given index sits at its start edge. Pass true as the second argument to animate the scrolling. | |
| ScrollToOffsetAsync | Task | Scrolls the list to an absolute offset in pixels on its scrolling axis. Pass true as the second argument to animate the scrolling. | |
| ScrollToStartAsync | Task | Scrolls the list to its start. Pass true to animate the scrolling. |
BitComponentBase parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| 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. |
| Disabled | bool | false | Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction. |
| 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. |
| 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. |
BitComponentBase public members
| Name | Type | Default value | Description |
|---|---|---|---|
| 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. |
BitBasicListClassStyles properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the list. |
| Header | string? | null | Custom CSS classes/styles for the header container of the list. |
| Items | string? | null | Custom CSS classes/styles for the element holding the rows, where a grid or a gap between them is laid out. |
| Footer | string? | null | Custom CSS classes/styles for the footer container of the list. |
| LoadingContent | string? | null | Custom CSS classes/styles for the loading container of the list. |
| LoadMoreButton | string? | null | Custom CSS classes/styles for the LoadMore button of the list. |
| LoadMoreText | string? | null | Custom CSS classes/styles for the LoadMore text of the list. |
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. |
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.