You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/extras/docs/components/Loading.md
+75-5Lines changed: 75 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,7 @@ import { Required } from '@site/src/components';
5
5
AMA provides an accessible `<Loading ... />` component that auto focuses and announces the accessibility label and busy state. This component wraps the standard [React Native ActivityIndicator](https://reactnative.dev/docs/activityindicator).
6
6
7
7
:::note
8
-
The `Loading` component by default is absolutely positioned and will fill it's parents container. In the example below this would be the `<View>`. This behaviour can be overridden by the `Loading` components props. See props section below.
9
-
:::
10
-
11
-
:::tip
12
-
Use the `Loading` component it as a top-level component in your screen while data is being fetched or as a replacement for sections of your screen that are loading to prevent accessibility users from interacting with data that is stale.
8
+
The `Loading` component by default is absolutely positioned and will fill it's parents container. This behavior can be overridden by the `Loading` components props. See [props](#props) section below.
13
9
:::
14
10
15
11
## Example
@@ -30,3 +26,77 @@ const Screen = () => {
30
26
);
31
27
};
32
28
```
29
+
30
+
:::tip
31
+
Use the `Loading` component it as a top-level component in your screen while data is being fetched or as a replacement for sections of your screen that are loading to prevent accessibility users from interacting with data that is stale.
32
+
:::
33
+
34
+
## Props
35
+
36
+
:::note
37
+
If you want to control the position of the loading indicator you can pass a `style` prop to the `Loading` component which will add styles to the `Loading` containers view. Alternatively you can completely override the current containers style by passing a `containerProps` prop with a style object key-value pair.
38
+
:::
39
+
40
+
### <Required /> `isLoading`
41
+
42
+
The isLoading state determines if the `Loading` component is returned and is required for the component to function.
43
+
44
+
| Type | Default |
45
+
| ------- | ------- |
46
+
| boolean | false |
47
+
48
+
### `title`
49
+
50
+
The text used in the `accessibilityLabel` and also shown below the activity indicator if `showTitle` is set to true (default).
51
+
52
+
| Type | Default |
53
+
| ------ | --------- |
54
+
| string | 'Loading' |
55
+
56
+
### `showTitle`
57
+
58
+
Whether or not a title text should be shown below the activity indicator.
59
+
60
+
| Type | Default |
61
+
| ------- | ------- |
62
+
| boolean | true |
63
+
64
+
### `style`
65
+
66
+
A prop to add styles to use for the `Loading` component container view with style merging (style arrays).
67
+
68
+
| Type | Default |
69
+
| --------- | --------- |
70
+
| ViewStyle | undefined |
71
+
72
+
<detailsopen>
73
+
<summary>Styles already applied to the `Loading` component container view</summary>
74
+
75
+
Your styles will be merged with these styles:
76
+
77
+
```css
78
+
{
79
+
position: 'absolute',
80
+
top: 0,
81
+
left: 0,
82
+
right: 0,
83
+
bottom: 0,
84
+
justifyContent: 'center',
85
+
alignItems: 'center',
86
+
zIndex: 100,
87
+
}
88
+
```
89
+
90
+
</details>
91
+
92
+
### `containerProps`
93
+
94
+
A prop to control any `Loading` component container view props.
The `Loading` component container is AMA's `AutofocusContainer` component. The `containerProps` prop is an object that will be spread onto the `AutofocusContainer` component.
0 commit comments