-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathSegmentedButtonOnlyIcons.tsx
More file actions
40 lines (34 loc) · 922 Bytes
/
SegmentedButtonOnlyIcons.tsx
File metadata and controls
40 lines (34 loc) · 922 Bytes
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
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { List, SegmentedButtons } from 'react-native-paper';
type TransportMode = 'walk' | 'train' | 'drive';
const SegmentedButtonOnlyIcons = () => {
const [value, setValue] = React.useState<TransportMode>('walk');
return (
<List.Section title={`Segmented Button - only icons`}>
<SegmentedButtons
onValueChange={setValue}
style={styles.group}
value={value}
buttons={[
{
icon: 'walk',
value: 'walk',
},
{
icon: 'train',
value: 'train',
},
{
icon: 'car',
value: 'drive',
},
]}
/>
</List.Section>
);
};
const styles = StyleSheet.create({
group: { paddingHorizontal: 20, justifyContent: 'center' },
});
export default SegmentedButtonOnlyIcons;