| 3 | import { useState } from "react"; |
| 4 | |
| 5 | export default function SwitchesExample() { |
| 6 | const [checked, setChecked] = useState(true); |
| 7 | |
| 8 | return ( |
| 9 | <View style={styles.container}> |
| 10 | <Text style={styles.header}>Switch Example</Text> |
| 11 | <Switch |
| 12 | checked={checked} |
| 13 | onCheckedChange={(v) => { |
| 14 | console.log("onCheckedChange", v); |
| 15 | setChecked(v); |
| 16 | }} |
| 17 | style={{ |
| 18 | width: 200, |
| 19 | height: 100, |
| 20 | }} |
| 21 | modifier={Modifier.shadow({ |
| 22 | ambientColor: "black", |
| 23 | elevation: 5, |
| 24 | shape: "rectangle", |
| 25 | spotColor: "black", |
| 26 | }).border({ width: 1, color: "green" })} |
| 27 | /> |
| 28 | </View> |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | const styles = StyleSheet.create({ |
| 33 | container: { |