forked from necolas/react-native-web
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.js
More file actions
68 lines (63 loc) · 1.69 KB
/
index.js
File metadata and controls
68 lines (63 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { CheckBox, StyleSheet, View } from 'react-native';
import React from 'react';
import Example from '../../shared/example';
function Divider() {
return <View style={styles.divider} />;
}
export default function CheckboxPage() {
const [checked, setChecked] = React.useState(true);
React.useEffect(() => {
const interval = setInterval(() => {
setChecked(!checked);
}, 2500);
return () => {
clearInterval(interval);
};
}, [checked]);
return (
<Example title="CheckBox">
<View style={styles.row}>
<CheckBox disabled style={styles.item} value={false} />
<Divider />
<CheckBox disabled style={styles.item} value={true} />
<Divider />
<CheckBox aria-readonly style={styles.item} value={true} />
</View>
<View style={styles.row}>
<CheckBox value={false} />
<Divider />
<CheckBox value={true} />
</View>
<View style={styles.row}>
<CheckBox color="#1DA1F2" value={true} />
<Divider />
<CheckBox color="#17BF63" value={true} />
<Divider />
<CheckBox color="#FFAD1F" value={true} />
<Divider />
<CheckBox color="#F45D22" value={true} />
<Divider />
<CheckBox color="#794BC4" value={true} />
<Divider />
<CheckBox color="#E0245E" value={true} />
</View>
<View style={styles.row}>
<CheckBox
color="#1DA1F2"
style={{ height: 32, width: 32 }}
value={checked}
/>
</View>
</Example>
);
}
const styles = StyleSheet.create({
row: {
alignItems: 'center',
flexDirection: 'row',
marginVertical: 20
},
divider: {
width: 10
}
});