• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.arkui.advanced.SwipeRefresher (Swipe Refresher)
2
3
4The swipe refresher is a component used to obtain and load content, typically with a pull-down gesture.
5
6
7
8> **NOTE**
9>
10> This component and its child components are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.
11
12
13## Modules to Import
14
15```
16import { SwipeRefresher } from '@ohos.arkui.advanced.SwipeRefresher'
17```
18
19
20## Child Components
21
22Not supported
23
24## Attributes
25The [universal attributes](ts-universal-attributes-size.md) are supported.
26
27
28## SwipeRefresher
29
30SwipeRefresher ({content?: string, isLoading: boolean})
31
32**Decorator**: @Component
33
34**System capability**: SystemCapability.ArkUI.ArkUI.Full
35
36**Parameters**
37
38| Name| Type| Mandatory| Decorator| Description|
39| -------- | -------- | -------- | -------- | -------- |
40| content | string | No| \@Prop | Text displayed when the content is loaded.|
41| isLoading | boolean | If yes, | \@Prop | Whether content is being loaded.<br> The value **true** means that content is being loaded, and **false** means the opposite. |
42
43## Events
44The [universal events](ts-universal-events-click.md) are supported.
45
46## Example
47```ts
48import { SwipeRefresher } from '@ohos.arkui.advanced.SwipeRefresher';
49
50@Entry
51@Component
52struct Index {
53  build() {
54    Column() {
55      SwipeRefresher({
56        content: 'Loading',
57        isLoading: true
58      })
59      SwipeRefresher({
60        content: '',
61        isLoading: true
62      })
63      SwipeRefresher({
64        content: 'Loading',
65        isLoading: false
66      })
67    }
68  }
69}
70```
71
72![Snipaste_2023-07-24_11-35-40](figures/Snipaste_2023-07-24_11-35-40.gif)
73