Skip to content

Commit 86a34cf

Browse files
grabbouczystyl
authored andcommitted
Documentation for ActivityIndicator (#266)
I am working on migrating documentation of ActivityIndicator from Rebolt to demonstrate the way we should handle this with `odoc`.
1 parent a1baf68 commit 86a34cf

File tree

3 files changed

+212
-2
lines changed

3 files changed

+212
-2
lines changed

docs/highlight.pack.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/activityIndicator.rei

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
/**
2+
Displays a circular loading indicator. Check {{:https://facebook.github.io/react-native/docs/activityindicator.html} React Native docs}
3+
for details.
4+
5+
{2 Example}
6+
7+
{[
8+
let component = ReasonReact.statelessComponent("MyComponent");
9+
10+
let make = _children => {
11+
...component,
12+
render: _self => <ActivityIndicator />,
13+
};
14+
]}
15+
16+
To render a default ActivityIndicator (spinner) you don't need to pass any props:
17+
18+
{2 Props}
19+
20+
All {{:../View-BsReactNative/#props} [View]} props are accepted.
21+
22+
{3 animating}
23+
24+
{[
25+
~animating: bool=?
26+
]}
27+
28+
{3 color}
29+
30+
Changes the color of the indicator. Can be either a named color ["tomato"], hex ["#ff0ff"] or an rgb ["rgb(255, 34, 11)"].
31+
32+
{[
33+
~color: Style.color=?
34+
]}
35+
36+
{3 size}
37+
38+
In order to change the size of the indicator pass one of the {{:http://2ality.com/2018/01/polymorphic-variants-reasonml.html} polymorphic variants}:
39+
40+
{[
41+
~size: [ | `large | `small | `exact(int)]=?
42+
]}
43+
44+
Note: [exact] is only supported on Android. On iOS, it defaults to [`small].
45+
*/
146
let make:
247
(
348
~animating: bool=?,
@@ -57,4 +102,4 @@ let make:
57102
ReasonReact.stateless,
58103
ReasonReact.noRetainedProps,
59104
unit,
60-
);
105+
);

src/components/view.rei

Lines changed: 157 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,160 @@
11
module type ViewComponent = {
2+
/**
3+
{2 Props}
4+
5+
{3 hidesWhenStopped}
6+
7+
{[
8+
~hidesWhenStopped: bool=?,
9+
]}
10+
11+
{3 accessibilityLabel}
12+
13+
{[
14+
~accessibilityLabel: ReasonReact.reactElement=?,
15+
]}
16+
17+
{3 accessible}
18+
19+
{[
20+
~accessible: bool=?,
21+
]}
22+
23+
{3 hitSlop}
24+
25+
{[
26+
~hitSlop: Types.insets=?,
27+
]}
28+
29+
{3 onAccessibilityTap}
30+
31+
{[
32+
~onAccessibilityTap: unit => unit=?,
33+
]}
34+
35+
{3 onLayout}
36+
37+
{[
38+
~onLayout: RNEvent.NativeLayoutEvent.t => unit=?,
39+
]}
40+
41+
{3 onMagicTap}
42+
43+
{[
44+
~onMagicTap: unit => unit=?,
45+
]}
46+
47+
{3 responderHandlers}
48+
49+
{[
50+
~responderHandlers: Types.touchResponderHandlers=?,
51+
]}
52+
53+
{3 pointerEvents}
54+
55+
{[
56+
~pointerEvents: [ | `auto | `none | `boxNone | `boxOnly]=?,
57+
]}
58+
59+
{3 removeClippedSubviews}
60+
61+
{[
62+
~removeClippedSubviews: bool=?,
63+
]}
64+
65+
{3 style}
66+
67+
{[
68+
~style: Style.t=?,
69+
]}
70+
71+
{3 testID}
72+
73+
{[
74+
~testID: string=?,
75+
]}
76+
77+
{3 accessibilityComponentType}
78+
79+
{[
80+
~accessibilityComponentType: [
81+
| `none
82+
| `button
83+
| `radiobutton_checked
84+
| `radiobutton_unchecked
85+
]
86+
=?
87+
]}
88+
89+
{3 accessibilityLiveRegion}
90+
91+
{[
92+
~accessibilityLiveRegion: [ | `none | `polite | `assertive]=?,
93+
]}
94+
95+
{3 collapsable}
96+
97+
{[
98+
~collapsable: bool=?
99+
]}
100+
101+
{3 importantForAccessibility}
102+
103+
{[
104+
~importantForAccessibility: [ | `auto | `yes | `no | `noHideDescendants]=?
105+
]}
106+
107+
{3 needsOffscreenAlphaCompositing}
108+
109+
{[
110+
~needsOffscreenAlphaCompositing: bool=?
111+
]}
112+
113+
{3 renderToHardwareTextureAndroid}
114+
115+
{[
116+
~renderToHardwareTextureAndroid: bool=?
117+
]}
118+
119+
{3 accessibilityTraits}
120+
121+
{[
122+
~accessibilityTraits: list(
123+
[
124+
| `none
125+
| `button
126+
| `link
127+
| `header
128+
| `search
129+
| `image
130+
| `selected
131+
| `plays
132+
| `key
133+
| `text
134+
| `summary
135+
| `disabled
136+
| `frequentUpdates
137+
| `startsMedia
138+
| `adjustable
139+
| `allowsDirectInteraction
140+
| `pageTurn
141+
],
142+
)
143+
=?,
144+
]}
145+
146+
{3 accessibilityViewIsModal}
147+
148+
{[
149+
~accessibilityViewIsModal: bool=?,
150+
]}
151+
152+
{3 shouldRasterizeIOS}
153+
154+
{[
155+
~shouldRasterizeIOS: bool=?,
156+
]}
157+
*/
2158
let make:
3159
(
4160
~accessibilityLabel: string=?,
@@ -62,4 +218,4 @@ module type Impl = {let view: ReasonReact.reactClass;};
62218

63219
module CreateComponent: (Impl: Impl) => ViewComponent;
64220

65-
include ViewComponent;
221+
include ViewComponent;

0 commit comments

Comments
 (0)