MCPcopy Create free account
hub / github.com/callstack/react-native-paper / ButtonExample

Function ButtonExample

example/src/Examples/ButtonExample.tsx:9–356  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import ScreenWrapper from '../ScreenWrapper';
8
9const ButtonExample = () => {
10 const theme = useExampleTheme();
11
12 const color = theme.isV3 ? theme.colors.inversePrimary : theme.colors.accent;
13
14 return (
15 <ScreenWrapper>
16 <List.Section title={`Text button ${theme.isV3 ? '(text)' : ''}`}>
17 <View style={styles.row}>
18 <Button onPress={() => {}} style={styles.button}>
19 Default
20 </Button>
21 <Button textColor={color} onPress={() => {}} style={styles.button}>
22 Custom
23 </Button>
24 <Button disabled onPress={() => {}} style={styles.button}>
25 Disabled
26 </Button>
27 <Button icon="camera" onPress={() => {}} style={styles.button}>
28 Icon
29 </Button>
30 <Button loading onPress={() => {}} style={styles.button}>
31 Loading
32 </Button>
33 <Button
34 icon="camera"
35 onPress={() => {}}
36 style={styles.button}
37 contentStyle={styles.flexReverse}
38 >
39 Icon right
40 </Button>
41 </View>
42 </List.Section>
43 {theme.isV3 && (
44 <List.Section title="Contained-tonal button (tonal)">
45 <View style={styles.row}>
46 <Button
47 mode="contained-tonal"
48 onPress={() => {}}
49 style={styles.button}
50 >
51 Default
52 </Button>
53 <Button
54 mode="contained-tonal"
55 buttonColor={color}
56 onPress={() => {}}
57 style={styles.button}
58 >
59 Custom
60 </Button>
61 <Button
62 mode="contained-tonal"
63 disabled
64 onPress={() => {}}
65 style={styles.button}
66 >

Callers

nothing calls this directly

Calls 1

useExampleThemeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…