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

Function SnackbarsExample

example/app/snackbars.tsx:11–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9import { useState } from "react";
10
11export default function SnackbarsExample() {
12 const [show, setShow] = useState(false);
13 const { width, height } = useWindowDimensions();
14 return (
15 <>
16 <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 20 }}>
17 <Text style={styles.header}>Snackbars Example</Text>
18 <Button text="Show Snackbar" onClick={() => setShow(true)} />
19 </ScrollView>
20 <Snackbar
21 style={{
22 position: "absolute",
23 bottom: 0,
24 right: 0,
25 width,
26 height,
27 backgroundColor: "transparent",
28 }}
29 message="I'm a snackbar"
30 show={show}
31 onDismiss={() => setShow(false)}
32 onActionPerformed={() => setShow(false)}
33 />
34 </>
35 );
36}
37
38const styles = StyleSheet.create({
39 header: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected