| 3 | import { useState } from "react"; |
| 4 | |
| 5 | export default function ButtonsExample() { |
| 6 | const [count, setCount] = useState(0); |
| 7 | |
| 8 | return ( |
| 9 | <View style={styles.container}> |
| 10 | <Text style={styles.header}>Button Examples</Text> |
| 11 | <View style={{ flexDirection: "row" }}> |
| 12 | <View style={{ flex: 1, gap: 10 }}> |
| 13 | <Button text="Default" onClick={() => setCount(count + 1)} /> |
| 14 | <Button |
| 15 | text="Outlined" |
| 16 | onClick={() => setCount(count + 1)} |
| 17 | variant="outlined" |
| 18 | /> |
| 19 | <Button |
| 20 | text="Text" |
| 21 | onClick={() => setCount(count + 1)} |
| 22 | variant="text" |
| 23 | /> |
| 24 | </View> |
| 25 | <View style={{ flex: 1, gap: 10 }}> |
| 26 | <Button |
| 27 | text="Elevated" |
| 28 | onClick={() => setCount(count + 1)} |
| 29 | variant="elevated" |
| 30 | /> |
| 31 | <Button |
| 32 | text="Filled Tonal" |
| 33 | onClick={() => setCount(count + 1)} |
| 34 | variant="filled-tonal" |
| 35 | /> |
| 36 | <Button |
| 37 | text="Floating Action" |
| 38 | onClick={() => setCount(count + 1)} |
| 39 | variant="floating-action" |
| 40 | modifier={Modifier.padding(5)} |
| 41 | /> |
| 42 | <Button |
| 43 | style={{ height: 60 }} |
| 44 | text="Extended Floating Action" |
| 45 | onClick={() => setCount(count + 1)} |
| 46 | variant="extended-floating-action" |
| 47 | /> |
| 48 | </View> |
| 49 | </View> |
| 50 | <Text>Button clicked {count} times</Text> |
| 51 | </View> |
| 52 | ); |
| 53 | } |
| 54 | |
| 55 | const styles = StyleSheet.create({ |
| 56 | container: { |