MCPcopy Create free account
hub / github.com/dabbott/react-native-express / Toggle

Function Toggle

examples/files/core_components/toggle.js:4–20  ·  view source on GitHub ↗
({ label, options, value, onChange })

Source from the content-addressed store, hash-verified

2import { View, Text, Button, StyleSheet } from 'react-native'
3
4export default function Toggle({ label, options, value, onChange }) {
5 return (
6 <View style={styles.container}>
7 <Text style={styles.label}>{label}</Text>
8 <View style={styles.optionsContainer}>
9 {options.map((option) => (
10 <Button
11 color={option === value ? '#3B6CD4' : '#AAA'}
12 onPress={() => onChange(option)}
13 title={option}
14 key={option}
15 />
16 ))}
17 </View>
18 </View>
19 )
20}
21
22const styles = StyleSheet.create({
23 container: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected