Skip to content

Utilities

PullToRefresh

Bit.BlazorUIRefreshViewRefresher

PullToRefresh adds the pull to refresh gesture to a page or any scrollable element. It engages only while the scroller is at its top - or at its bottom, for a pull up - damps the pull, and holds an indicator open until the refresh is done - by touch, by mouse, or from code.

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

Wrap a scrollable element and handle OnRefresh. Drag it down from its top - by touch or mouse - and release past the trigger: the indicator stays open until the awaited handler returns. A sideways drag is left to the content.

01. Item 13
02. Item 14
03. Item 10
04. Item 26
05. Item 3
06. Item 45
07. Item 19
08. Item 25
09. Item 24
10. Item 2
11. Item 13
12. Item 40
13. Item 46
14. Item 27
15. Item 11
16. Item 14
17. Item 19
18. Item 34
19. Item 29
20. Item 15
21. Item 12
22. Item 49
23. Item 20
24. Item 22
25. Item 19
26. Item 39
27. Item 9
28. Item 14
29. Item 20
30. Item 2
31. Item 13
32. Item 1
33. Item 9
34. Item 24
35. Item 36
36. Item 20
37. Item 50
38. Item 49
39. Item 29
40. Item 23
41. Item 47
42. Item 17
43. Item 13
44. Item 46
45. Item 50
46. Item 16
47. Item 42
48. Item 17
49. Item 30
50. Item 26

Behavior

Trigger: the pull height that refreshes, and the distance the indicator grows over. Factor: divides the finger travel - higher is heavier. Margin: room added above the indicator. Threshold: a dead zone crossed before anything appears. MaxPull: lets the pull go past the trigger instead of stopping there (0 stops it). Changes apply at once.

01. Item 2
02. Item 39
03. Item 1
04. Item 28
05. Item 40
06. Item 33
07. Item 19
08. Item 44
09. Item 42
10. Item 16
11. Item 38
12. Item 16
13. Item 36
14. Item 8
15. Item 6
16. Item 50
17. Item 32
18. Item 34
19. Item 31
20. Item 11
21. Item 35
22. Item 44
23. Item 13
24. Item 3
25. Item 25
26. Item 41
27. Item 28
28. Item 3
29. Item 33
30. Item 18
31. Item 33
32. Item 15
33. Item 31
34. Item 5
35. Item 20
36. Item 40
37. Item 45
38. Item 42
39. Item 1
40. Item 45
41. Item 10
42. Item 16
43. Item 13
44. Item 5
45. Item 19
46. Item 14
47. Item 45
48. Item 24
49. Item 18
50. Item 39




Direction

Direction sets the way the pull travels. Up engages once the scroller has reached its bottom and opens the strip over the bottom of the anchor - the gesture of a chat or a feed that loads more at its end. Scroll to the end of the list, then drag it up past the end: each refresh here appends ten more items. Everything else - the trigger, the factor, the margin, the threshold and the overpull - works the same either way.

01. Item 14
02. Item 12
03. Item 4
04. Item 5
05. Item 11
06. Item 18
07. Item 11
08. Item 16
09. Item 17
10. Item 12
11. Item 2
12. Item 11
13. Item 11
14. Item 12
15. Item 4
16. Item 7
17. Item 7
18. Item 5
19. Item 8
20. Item 18

Scroller and full width

ScrollerSelector (or ScrollerElement) names the element that actually scrolls, so the pull engages only while it is at its top - left unset, the anchor's first element is used, and body hangs the gesture off the page. A nested scroller that is not at its own top keeps the drag for itself. FullWidth fills the layout region instead of shrink-wrapping the content.

BlazorUI

01. Item 36
02. Item 2
03. Item 43
04. Item 45
05. Item 50
06. Item 32
07. Item 29
08. Item 27
09. Item 19
10. Item 28
11. Item 33
12. Item 6
13. Item 33
14. Item 12
15. Item 42
16. Item 41
17. Item 37
18. Item 42
19. Item 5
20. Item 17
21. Item 10
22. Item 31
23. Item 37
24. Item 34
25. Item 42
26. Item 2
27. Item 13
28. Item 14
29. Item 8
30. Item 45
31. Item 2
32. Item 23
33. Item 37
34. Item 14
35. Item 27
36. Item 27
37. Item 7
38. Item 33
39. Item 18
40. Item 11
41. Item 39
42. Item 1
43. Item 18
44. Item 14
45. Item 41
46. Item 2
47. Item 37
48. Item 49
49. Item 27
50. Item 9

States and templates

Past the trigger the glyph comes up to full strength: releasing now refreshes. CompleteDelay holds a checkmark open for that many milliseconds after the refresh (0 skips it). Loading, Release and Complete replace the glyph of each stage; they scale with the pull, so size them in relative units. IndicatorTemplate replaces the whole indicator, unscaled - a text one here - and gets the State and Progress of the pull.

01. Item 23
02. Item 35
03. Item 49
04. Item 50
05. Item 49
06. Item 50
07. Item 8
08. Item 20
09. Item 6
10. Item 32
11. Item 32
12. Item 19
13. Item 45
14. Item 11
15. Item 10
16. Item 44
17. Item 29
18. Item 2
19. Item 40
20. Item 37
21. Item 20
22. Item 42
23. Item 39
24. Item 43
25. Item 28
26. Item 48
27. Item 28
28. Item 38
29. Item 34
30. Item 50
31. Item 40
32. Item 9
33. Item 14
34. Item 3
35. Item 30
36. Item 50
37. Item 12
38. Item 40
39. Item 49
40. Item 49
41. Item 17
42. Item 11
43. Item 28
44. Item 38
45. Item 13
46. Item 27
47. Item 27
48. Item 16
49. Item 12
50. Item 35
51. Item 54
52. Item 100
53. Item 91
54. Item 97
55. Item 79
56. Item 55
57. Item 51
58. Item 93
59. Item 95
60. Item 96
61. Item 63
62. Item 75
63. Item 89
64. Item 89
65. Item 97
66. Item 98
67. Item 71
68. Item 68
69. Item 82
70. Item 70
71. Item 85
72. Item 91
73. Item 79
74. Item 87
75. Item 74
76. Item 59
77. Item 93
78. Item 99
79. Item 70
80. Item 80
81. Item 61
82. Item 62
83. Item 55
84. Item 66
85. Item 69
86. Item 76
87. Item 88
88. Item 58
89. Item 97
90. Item 94
91. Item 93
92. Item 56
93. Item 72
94. Item 100
95. Item 54
96. Item 86
97. Item 82
98. Item 81
99. Item 52
100. Item 67
101. Item 132
102. Item 101
103. Item 129
104. Item 132
105. Item 122
106. Item 130
107. Item 122
108. Item 114
109. Item 111
110. Item 149
111. Item 129
112. Item 103
113. Item 139
114. Item 143
115. Item 138
116. Item 103
117. Item 124
118. Item 117
119. Item 106
120. Item 107
121. Item 123
122. Item 106
123. Item 120
124. Item 137
125. Item 149
126. Item 106
127. Item 141
128. Item 136
129. Item 132
130. Item 133
131. Item 108
132. Item 139
133. Item 147
134. Item 114
135. Item 136
136. Item 138
137. Item 131
138. Item 148
139. Item 116
140. Item 148
141. Item 117
142. Item 131
143. Item 131
144. Item 148
145. Item 131
146. Item 140
147. Item 142
148. Item 108
149. Item 103
150. Item 136

Programmatic refresh

RefreshAsync runs a refresh from code exactly as a released pull does, and completes with it (so an AutoLoading button stays busy for the whole refresh); IsRefreshing says one is running. A button is the keyboard and single-pointer alternative a drag gesture needs (WCAG 2.5.7).

The stages are announced through a live region: ReleaseLabel (an empty string silences it), RefreshingLabel and CompleteLabel; AriaLabel names the region.



01. Message 33
02. Message 48
03. Message 10
04. Message 17
05. Message 43
06. Message 24
07. Message 47
08. Message 30
09. Message 23
10. Message 25
11. Message 25
12. Message 40
13. Message 31
14. Message 23
15. Message 7
16. Message 24
17. Message 15
18. Message 43
19. Message 16
20. Message 39
21. Message 5
22. Message 46
23. Message 17
24. Message 19
25. Message 4
26. Message 25
27. Message 35
28. Message 25
29. Message 39
30. Message 50
31. Message 41
32. Message 49
33. Message 26
34. Message 46
35. Message 42
36. Message 18
37. Message 7
38. Message 40
39. Message 35
40. Message 43
41. Message 11
42. Message 2
43. Message 12
44. Message 30
45. Message 32
46. Message 41
47. Message 30
48. Message 33
49. Message 25
50. Message 22

Events

OnPullStart hands over the anchor's position and width, OnPullMove streams the pull height (one report per frame), OnPullEnd fires on release, OnPullCancel when the gesture is taken away, and OnRefresh once a release commits. OnStateChange reports each change of State - idle, pulling, can release, refreshing, complete - once, which is what drives a status text or a busy indicator elsewhere. PullProgress is the pull as a fraction of the trigger.

01. Item 44
02. Item 28
03. Item 25
04. Item 8
05. Item 39
06. Item 21
07. Item 21
08. Item 3
09. Item 42
10. Item 50
11. Item 10
12. Item 37
13. Item 24
14. Item 13
15. Item 48
16. Item 11
17. Item 49
18. Item 2
19. Item 1
20. Item 27
21. Item 10
22. Item 31
23. Item 17
24. Item 46
25. Item 39
26. Item 13
27. Item 17
28. Item 19
29. Item 6
30. Item 1
31. Item 19
32. Item 2
33. Item 43
34. Item 11
35. Item 37
36. Item 50
37. Item 41
38. Item 34
39. Item 42
40. Item 29
41. Item 20
42. Item 33
43. Item 1
44. Item 48
45. Item 12
46. Item 8
47. Item 45
48. Item 4
49. Item 4
50. Item 29
State: Idle
PullStart: -
PullMove: 0.0 (0%)
PullEnd: 0.0
PullCancel: 0.0
Refresh count: 0

Disabled and touch only

Disabled turns the gesture off and gives scrolling back to the browser; the content stays interactive. NoMouse keeps it for touch and pen, leaving a mouse drag to select text. A mouse drag that starts in a form field is always left to the field.


01. Item 44
02. Item 48
03. Item 42
04. Item 28
05. Item 13
06. Item 16
07. Item 2
08. Item 35
09. Item 5
10. Item 36
11. Item 10
12. Item 24
13. Item 31
14. Item 40
15. Item 6
16. Item 7
17. Item 40
18. Item 42
19. Item 10
20. Item 28
21. Item 11
22. Item 37
23. Item 37
24. Item 40
25. Item 44
26. Item 1
27. Item 6
28. Item 47
29. Item 6
30. Item 5
31. Item 27
32. Item 21
33. Item 46
34. Item 24
35. Item 26
36. Item 29
37. Item 31
38. Item 34
39. Item 31
40. Item 44
41. Item 38
42. Item 9
43. Item 41
44. Item 42
45. Item 44
46. Item 5
47. Item 38
48. Item 12
49. Item 38
50. Item 2

Cascading parameters

BitParams hands a BitPullToRefreshParams to every pull to refresh under it, so an app sets the feel, the states and the labels of its refreshers once. They are defaults: a component's own parameters win, as the Trigger on the right does.

01. Item 34
02. Item 4
03. Item 9
04. Item 13
05. Item 7
06. Item 9
07. Item 11
08. Item 32
09. Item 33
10. Item 4
11. Item 31
12. Item 34
13. Item 38
14. Item 46
15. Item 6
16. Item 16
17. Item 22
18. Item 20
19. Item 29
20. Item 25
21. Item 12
22. Item 50
23. Item 30
24. Item 9
25. Item 8
26. Item 32
27. Item 41
28. Item 46
29. Item 24
30. Item 33
31. Item 40
32. Item 31
33. Item 49
34. Item 8
35. Item 33
36. Item 48
37. Item 3
38. Item 40
39. Item 34
40. Item 44
41. Item 5
42. Item 15
43. Item 10
44. Item 26
45. Item 43
46. Item 9
47. Item 50
48. Item 6
49. Item 8
50. Item 40
51. Item 58
52. Item 57
53. Item 98
54. Item 89
55. Item 94
56. Item 72
57. Item 58
58. Item 97
59. Item 70
60. Item 85
61. Item 97
62. Item 62
63. Item 60
64. Item 92
65. Item 82
66. Item 67
67. Item 61
68. Item 93
69. Item 64
70. Item 92
71. Item 61
72. Item 85
73. Item 61
74. Item 87
75. Item 89
76. Item 100
77. Item 87
78. Item 75
79. Item 51
80. Item 83
81. Item 58
82. Item 57
83. Item 74
84. Item 59
85. Item 68
86. Item 75
87. Item 71
88. Item 64
89. Item 89
90. Item 57
91. Item 75
92. Item 62
93. Item 96
94. Item 88
95. Item 92
96. Item 72
97. Item 54
98. Item 55
99. Item 62
100. Item 53

Color

Color paints the glyph with a theme color; CustomColor takes any CSS color and applies only while Color is unset.

01. Item 15
02. Item 28
03. Item 4
04. Item 27
05. Item 31
06. Item 17
07. Item 33
08. Item 3
09. Item 25
10. Item 44
11. Item 2
12. Item 46
13. Item 14
14. Item 11
15. Item 12
16. Item 2
17. Item 3
18. Item 44
19. Item 45
20. Item 9
21. Item 11
22. Item 42
23. Item 42
24. Item 38
25. Item 8
26. Item 12
27. Item 24
28. Item 5
29. Item 36
30. Item 50
31. Item 49
32. Item 27
33. Item 11
34. Item 27
35. Item 3
36. Item 9
37. Item 43
38. Item 17
39. Item 34
40. Item 18
41. Item 22
42. Item 10
43. Item 14
44. Item 14
45. Item 27
46. Item 20
47. Item 40
48. Item 40
49. Item 12
50. Item 21
51. Item 92
52. Item 52
53. Item 69
54. Item 58
55. Item 99
56. Item 63
57. Item 83
58. Item 59
59. Item 67
60. Item 76
61. Item 51
62. Item 75
63. Item 72
64. Item 76
65. Item 97
66. Item 92
67. Item 51
68. Item 95
69. Item 97
70. Item 67
71. Item 94
72. Item 94
73. Item 98
74. Item 60
75. Item 66
76. Item 67
77. Item 67
78. Item 98
79. Item 57
80. Item 59
81. Item 76
82. Item 59
83. Item 98
84. Item 96
85. Item 72
86. Item 88
87. Item 72
88. Item 67
89. Item 53
90. Item 74
91. Item 95
92. Item 100
93. Item 83
94. Item 83
95. Item 72
96. Item 69
97. Item 69
98. Item 81
99. Item 58
100. Item 67

Style & Class

Styles and Classes reach the strip, the disc and the glyph, each with a release, refreshing and complete variant - pull past the trigger to see the release one.

The component also reads CSS variables for the size, fill, shadow and colors of its indicator. They inherit, so a value on :root re-skins every instance and one on Style a single one, like the right-hand one here.

01. Item 26
02. Item 5
03. Item 6
04. Item 35
05. Item 4
06. Item 10
07. Item 3
08. Item 16
09. Item 29
10. Item 39
11. Item 25
12. Item 30
13. Item 49
14. Item 29
15. Item 38
16. Item 43
17. Item 1
18. Item 24
19. Item 12
20. Item 13
21. Item 49
22. Item 13
23. Item 30
24. Item 19
25. Item 28
26. Item 7
27. Item 5
28. Item 44
29. Item 45
30. Item 2
31. Item 46
32. Item 48
33. Item 47
34. Item 18
35. Item 28
36. Item 44
37. Item 13
38. Item 10
39. Item 9
40. Item 23
41. Item 14
42. Item 38
43. Item 25
44. Item 4
45. Item 34
46. Item 9
47. Item 24
48. Item 44
49. Item 31
50. Item 16
51. Item 74
52. Item 84
53. Item 80
54. Item 70
55. Item 64
56. Item 80
57. Item 72
58. Item 55
59. Item 58
60. Item 80
61. Item 100
62. Item 55
63. Item 74
64. Item 77
65. Item 97
66. Item 81
67. Item 57
68. Item 90
69. Item 56
70. Item 90
71. Item 56
72. Item 68
73. Item 69
74. Item 61
75. Item 77
76. Item 61
77. Item 98
78. Item 62
79. Item 68
80. Item 82
81. Item 78
82. Item 80
83. Item 76
84. Item 52
85. Item 75
86. Item 94
87. Item 69
88. Item 62
89. Item 95
90. Item 90
91. Item 58
92. Item 61
93. Item 91
94. Item 66
95. Item 94
96. Item 53
97. Item 61
98. Item 72
99. Item 95
100. Item 81
101. Item 110
102. Item 140
103. Item 130
104. Item 115
105. Item 121
106. Item 134
107. Item 139
108. Item 136
109. Item 127
110. Item 122
111. Item 149
112. Item 121
113. Item 135
114. Item 131
115. Item 146
116. Item 149
117. Item 119
118. Item 118
119. Item 122
120. Item 124
121. Item 113
122. Item 129
123. Item 148
124. Item 116
125. Item 133
126. Item 134
127. Item 134
128. Item 116
129. Item 118
130. Item 129
131. Item 135
132. Item 141
133. Item 134
134. Item 131
135. Item 145
136. Item 129
137. Item 147
138. Item 123
139. Item 148
140. Item 104
141. Item 119
142. Item 140
143. Item 113
144. Item 124
145. Item 116
146. Item 118
147. Item 139
148. Item 123
149. Item 104
150. Item 142

RTL

The pull is vertical, so Dir leaves it as it is; it flips the content and pins the strip to the start edge.

01 .مورد 30
02 .مورد 34
03 .مورد 32
04 .مورد 14
05 .مورد 45
06 .مورد 20
07 .مورد 38
08 .مورد 14
09 .مورد 43
10 .مورد 5
11 .مورد 33
12 .مورد 7
13 .مورد 33
14 .مورد 46
15 .مورد 24
16 .مورد 21
17 .مورد 22
18 .مورد 50
19 .مورد 17
20 .مورد 45
21 .مورد 39
22 .مورد 41
23 .مورد 46
24 .مورد 25
25 .مورد 28
26 .مورد 16
27 .مورد 23
28 .مورد 6
29 .مورد 1
30 .مورد 43
31 .مورد 11
32 .مورد 7
33 .مورد 38
34 .مورد 26
35 .مورد 13
36 .مورد 6
37 .مورد 45
38 .مورد 23
39 .مورد 9
40 .مورد 35
41 .مورد 13
42 .مورد 12
43 .مورد 13
44 .مورد 16
45 .مورد 46
46 .مورد 27
47 .مورد 1
48 .مورد 2
49 .مورد 36
50 .مورد 50

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 it - and any instance nested inside it, which inherits the value too; a parameter changes one alone, as does the real CSS property on the instance's Style / Styles when that property does not inherit (opacity: 1 keeps one disabled instance undimmed without undimming a disabled one inside it), while an inherited one such as color or font-family also reaches the nested instances that do not set it themselves. Leave a variable unset and the component falls back to the theme token beside it.

BitPullToRefresh CSS variables

Name Default value Description
--bit-PullToRefresh-color --bit-clr-fg-pri Color of the glyph. The Color and CustomColor parameters win over it.
--bit-PullToRefresh-pull-opacity 0.6 Opacity of the glyph while the pull falls short of the trigger; it is full once releasing would refresh.
--bit-PullToRefresh-indicator-size --bit-siz-ctrl-md Diameter of the indicator's disc at the trigger; below it, the disc is drawn at the fraction of it the pull has come.
--bit-PullToRefresh-glyph-size --bit-siz-icon-lg Size of the glyph inside the disc at the trigger, scaled with the pull the same way.
--bit-PullToRefresh-indicator-background --bit-clr-bg-pri Fill of the disc.
--bit-PullToRefresh-indicator-shadow --bit-shd-popup Elevation of the disc.
--bit-PullToRefresh-indicator-radius --bit-shp-radius-full Corners of the disc.
--bit-PullToRefresh-refreshing-background --bit-clr-bg-ter Fill of the disc while the refresh runs.
--bit-PullToRefresh-complete-background --bit-PullToRefresh-refreshing-background Fill of the disc in the complete state.
--bit-PullToRefresh-strip-background transparent Fill of the strip the pull opens over the top of the anchor.
--bit-PullToRefresh-z-index 1 Layer of the strip over the anchor's content, to lift it above a sticky header inside it.

API

Every parameter, public member, sub-class and enum this component exposes.

BitPullToRefresh parameters

Name Type Default value Description
Anchor RenderFragment? null The anchor element that the pull to refresh component adheres to (alias of ChildContent).
ChildContent RenderFragment? null The anchor element that the pull to refresh component adheres to.
Classes BitPullToRefreshClassStyles? null Custom CSS classes for different parts of the BitPullToRefresh.
Color BitColor? null The general color of the pull indicator. It colors the glyph inside the indicator's disc, which the pull, the refresh and the complete states all draw.
Complete RenderFragment? null The custom template to replace the default checkmark svg shown while the complete state is visible.
CompleteDelay int 0 The duration in milliseconds to keep the complete indicator visible after a successful refresh before snapping back (0 disables the complete state). It is skipped when OnRefresh throws.
CompleteLabel string Refresh complete The text that gets announced to screen readers while the complete state is visible after a successful refresh.
CustomColor string? null The custom css color of the pull indicator. It only applies while Color is left unset.
Direction BitPullToRefreshDirection BitPullToRefreshDirection.Down The direction the pull travels in to refresh. Down engages while the scroller is at its top and opens the strip over the top of the anchor; Up engages while it is at its bottom and opens the strip over the bottom of the anchor. The trigger, factor, margin, threshold and overpull are measured along the chosen direction, and the reported pull height is never negative.
Factor decimal 1.5 The factor to balance the pull height out. The pull-down distance gets divided by it, so higher values make the pull feel heavier. Values below 0.1 are treated as 0.1.
FullWidth bool false Whether the component takes the whole width of its container instead of shrink-wrapping its anchor.
IndicatorTemplate RenderFragment<BitPullToRefreshIndicatorContext>? null The custom template to replace the whole indicator - the disc and the glyph inside it. It gets the State and the PullProgress of the gesture, is drawn unscaled and unturned in the middle of the strip (which makes it the one for a text indicator), and takes over from Loading, Release and Complete. While it is set, the component re-renders for every pixel of a pull.
Loading RenderFragment? null The custom loading template to replace the default loading svg. It is what the indicator shows while the pull is under way and while the refresh is running, so it covers every state that Release and Complete do not take over. It scales with the pull, so size it in relative units.
Margin int 30 The value in pixel to add to the top of pull element as a margin for the pull height.
MaxPull int 0 The furthest the pull can travel, in pixels, past which it stops following the finger; 0 stops it at Trigger. The indicator holds its full size over that stretch, and only the strip keeps growing. It is measured on the same damped scale as Trigger.
NoMouse bool false Leaves the mouse out of the gesture, so that only touch and pen pull to refresh. A mouse or pen drag that starts on a form field or editable content is left to it either way.
OnPullCancel EventCallback<decimal> The callback for when the pull-down gets canceled before release, providing the last pull height.
OnPullEnd EventCallback<decimal> The callback for the ending of the pull-down.
OnPullMove EventCallback<decimal> The callback for when the pull-down is in progress, reporting the pull height in pixels, which is capped at Trigger - or at MaxPull where the pull is allowed past it. The reports are coalesced to at most one per frame and never repeat a whole pixel.
OnPullStart EventCallback<BitPullToRefreshPullStartArgs> The callback for the starting of the pull-down.
OnRefresh EventCallback The callback for when the trigger condition of the pull-down happens.
OnStateChange EventCallback<BitPullToRefreshState> The callback for when the gesture moves on to another stage, reported once per change. It is the one callback that hears the refresh end, since the parent re-renders for OnRefresh before the indicator closes. The gesture does not wait for it, so a slow handler never holds up the refresh; an exception it throws goes to the error boundary.
RefreshingLabel string Refreshing The text that gets announced to screen readers while the refresh is in progress.
Release RenderFragment? null The custom template to replace the glyph while the pull has passed the trigger and releasing starts the refresh. Without it, the Loading glyph is drawn there at full strength instead of faded.
ReleaseLabel string Release to refresh The text that gets announced to screen readers while the pull has passed the trigger and releasing starts the refresh. An empty string leaves the release state unannounced.
ScrollerElement ElementReference? null The element that is the scroller in the anchor to control the behavior of the pull to refresh.
ScrollerSelector string? null The CSS selector of the element that is the scroller in the anchor to control the behavior of the pull to refresh. It is looked up inside the anchor first and in the document afterwards, so "body" hangs the gesture off the page; left unset, the first element of the anchor is taken as the scroller.
Styles BitPullToRefreshClassStyles? null Custom CSS styles for different parts of the BitPullToRefresh.
Threshold int 0 The dead-zone distance in pixel that the pull-down must travel before the pull to refresh process starts and the indicator appears.
Trigger int 80 The pulling height in pixel that triggers the refresh. It is also the distance the indicator grows to its full size over. Values below 1 are treated as 1.

BitPullToRefresh public members

Name Type Default value Description
IsRefreshing bool false Whether a refresh is currently running - the pull was released past the trigger, or RefreshAsync was called, and the OnRefresh callback has not returned yet.
PullProgress decimal 0 How far the current pull has come as a fraction of Trigger: 0 while nothing is being pulled, and 1 once releasing would start a refresh. It reads 1 for the whole of a refresh.
State BitPullToRefreshState Idle The stage of the gesture the component is at: idle, pulling, past the trigger, refreshing or complete. OnStateChange reports every change of it.
RefreshAsync Task Starts the refresh process programmatically, showing the loading indicator and invoking the OnRefresh callback. It has no effect while the component is disabled, a refresh is already in progress or the complete state is visible.

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. An attribute written on the component wins over an entry of the same name.
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.

BitPullToRefreshPullStartArgs properties

Name Type Default value Description
Top decimal The top offset of the pull to refresh element in pixels.
Left decimal The left offset of the pull to refresh element in pixels.
Width decimal The width of the pull to refresh element in pixels.

BitPullToRefreshIndicatorContext properties

Name Type Default value Description
State BitPullToRefreshState The stage of the gesture the component is at: idle, pulling, past the trigger, refreshing or complete.
Progress decimal How far the pull has come as a fraction of the trigger: 0 while nothing is being pulled, and 1 once releasing would start a refresh, for the whole of the refresh and in the complete state.

BitPullToRefreshClassStyles properties

Name Type Default value Description
Root string? null Custom CSS classes/styles for the root element of the PullToRefresh.
Loading string? null Custom CSS classes/styles for the loading element.
SpinnerWrapper string? null Custom CSS classes/styles for the spinner wrapper element.
SpinnerWrapperCanRelease string? null Custom CSS classes/styles for the spinner wrapper element when the pull passed the trigger and releasing starts the refresh.
SpinnerWrapperRefreshing string? null Custom CSS classes/styles for the spinner wrapper element in refreshing mode.
SpinnerWrapperComplete string? null Custom CSS classes/styles for the spinner wrapper element while the complete state is visible after a successful refresh.
Spinner string? null Custom CSS classes/styles for the spinner element.
SpinnerCanRelease string? null Custom CSS classes/styles for the spinner element when the pull passed the trigger and releasing starts the refresh.
SpinnerRefreshing string? null Custom CSS classes/styles for the spinner element in refreshing mode.
SpinnerComplete string? null Custom CSS classes/styles for the spinner element while the complete state is visible after a successful refresh.

BitPullToRefreshState enum

Name Value Description
Idle 0 Nothing is being pulled and no refresh is running.
Pulling 1 A pull is under way but has not reached the trigger, so letting go drops it.
CanRelease 2 The pull has passed the trigger, so letting go starts the refresh.
Refreshing 3 The refresh is running: the OnRefresh callback has not returned yet.
Complete 4 The refresh has finished and the complete indicator is held open for the CompleteDelay.

BitPullToRefreshDirection enum

Name Value Description
Down 0 Pulled down while the scroller is at its top, opening the strip over the top of the anchor.
Up 1 Pulled up while the scroller is at its bottom, opening the strip over the bottom of the anchor.

BitColor enum

Name Value Description
Primary 0 Primary general color.
Secondary 1 Secondary general color.
Tertiary 2 Tertiary general color.
Info 3 Info general color.
Success 4 Success general color.
Warning 5 Warning general color.
SevereWarning 6 SevereWarning general color.
Error 7 Error general color.
PrimaryBackground 8 Primary background color.
SecondaryBackground 9 Secondary background color.
TertiaryBackground 10 Tertiary background color.
PrimaryForeground 11 Primary foreground color.
SecondaryForeground 12 Secondary foreground color.
TertiaryForeground 13 Tertiary foreground color.
PrimaryBorder 14 Primary border color.
SecondaryBorder 15 Secondary border color.
TertiaryBorder 16 Tertiary border color.

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.