MCPcopy Create free account
hub / github.com/andrew-levy/jetpack-compose-react-native / SwitchesExample

Function SwitchesExample

example/app/switches.tsx:5–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { useState } from "react";
4
5export 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
32const styles = StyleSheet.create({
33 container: {

Callers

nothing calls this directly

Calls 2

borderMethod · 0.65
shadowMethod · 0.65

Tested by

no test coverage detected