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

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




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 6
02. Item 15
03. Item 8
04. Item 18
05. Item 6
06. Item 12
07. Item 9
08. Item 13
09. Item 12
10. Item 17
11. Item 17
12. Item 3
13. Item 20
14. Item 19
15. Item 16
16. Item 9
17. Item 2
18. Item 17
19. Item 10
20. Item 2

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

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

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

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

Color

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

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

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

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

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.