{"id":1626,"date":"2025-07-05T10:49:30","date_gmt":"2025-07-05T10:49:30","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=1626"},"modified":"2025-07-07T05:16:20","modified_gmt":"2025-07-07T05:16:20","slug":"flmsnackbar","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2025\/07\/05\/flmsnackbar\/","title":{"rendered":"\uc2a4\ub0b5\ubc14\/FlmSnackbar"},"content":{"rendered":"\n<p>&#8212; \uc2a4\ub0b5\ubc14\ub294 \ud1a0\uc2a4\ud2b8\uba54\uc138\uc9c0\uc640 \uc720\uc0ac\ud55c \uae30\ub2a5\uc785\ub2c8\ub2e4.<br>Snackbar is similar to Toast Message.<\/p>\n\n\n\n<p>&#8212; \uc2a4\ud06c\ub9b0\uc0f7\/ScreenShot<br>\uad6c\uae00\ub4dc\ub77c\uc774\ube0c\/Google Drive : <br><a rel=\"noreferrer noopener\" href=\"https:\/\/drive.google.com\/drive\/folders\/1hhhIYmU8kSGOUTN9wd7H9igSppl6AE71?usp=drive_link\" target=\"_blank\">https:\/\/drive.google.com\/drive\/folders\/1hhhIYmU8kSGOUTN9wd7H9igSppl6AE71?usp=drive_link<\/a><\/p>\n\n\n\n<p><strong>1.react-native-freelifemakers-ui NPM \ubaa8\ub4c8 \uc124\uce58\ud558\uae30 \/ react-native-freelifemakers-ui NPM Module Instal<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install react-native-freelifemakers-ui<\/code><\/pre>\n\n\n\n<p><strong>2.\uc0ac\uc6a9\ud558\uae30 \/ Usage<\/strong><br>1)\uae30\ubcf8SnackBar \/ Default(ContextAPI) FlmSnackBar<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nimport {\n  FlmSnackBarProvider,\n  useFlmSnackBar,\n  FlmText,\n  FlmButton,\n} from 'react-native-freelifemakers-ui';\n\nconst FlmSnackBarApp = () =&gt; {\n  const {showSnackBar} = useFlmSnackBar();\n  return (\n   &lt;View style={styles.content}&gt;\n         &lt;FlmButton\n        title=\"\uae30\ubcf8 SnackBar\/Default SnackBar\"\n        onPress={() =&gt; showSnackBar('\uae30\ubcf8 SnackBar \uba54\uc2dc\uc9c0\uc785\ub2c8\ub2e4!')}\n      \/&gt;\n    &lt;\/View&gt;\n  );\n}\n\nexport default function App() {\n  return (\n    &lt;FlmSnackBarProvider&gt;\n      &lt;View&gt;\n        &lt;FlmSnackBarApp \/&gt;\n      &lt;\/View&gt;\n    &lt;\/FlmSnackBarProvider&gt;\n  );\n}<\/code><\/pre>\n\n\n\n<p><strong>2)\uc0ac\uc6a9\uc790\uc815\uc758 FlmSnackBar \/ Custom FlmSnackBar<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import {FlmSnackBar, FlmButton} from 'react-native-freelifemakers-ui';\n\nexport default function App() {\n  const &#91;showCustomSnackBar, setShowCustomSnackBar] = useState(false);\n  const &#91;snackBarMessage, setSnackBarMessage] = useState('');\n  const &#91;snackBarType, setSnackBarType] = useState('info');\n\n  const handleShowCustomSnackBar = (message, type) =&gt; {\n    setSnackBarMessage(message);\n    setSnackBarType(type);\n    setShowCustomSnackBar(true);\n  };\n\n  return (\n    &lt;View&gt;\n      &lt;FlmButton\n        title=\"\ucee4\uc2a4\ud140 SnackBar\/Cusom SnackBar\"\n        onPress={() =&gt;\n          handleShowCustomSnackBar('\uc0ac\uc6a9\uc790 \uc815\uc758 SnackBar', 'success')\n        }\n      \/&gt;\n\n      {showCustomSnackBar &amp;&amp; (\n        &lt;FlmSnackBar\n          message={snackBarMessage}\n          type={snackBarType}\n          duration={3000} \/\/ \uc9c1\uc811 \uc2dc\uac04 \uc124\uc815(3s) \/ time Time setting(3s)\n          onHide={() =&gt; setShowCustomSnackBar(false)}\n          \/\/ \ucee4\uc2a4\ud140 \uc2a4\ud0c0\uc77c \ucd94\uac00 \/.  adding custom style\n          style={{\n            backgroundColor: 'purple',\n            bottom: 100,\n            borderRadius: 20,\n            borderWidth: 2,\n            borderColor: 'white',\n          }}\n          textStyle={{\n            color: 'lightgreen',\n            fontWeight: 'bold',\n          }}\n        \/&gt;\n      )}\n    &lt;\/View&gt;\n  );\n}<\/code><\/pre>\n\n\n\n<p><strong>3.\uc608\uc81c\ucf54\ub4dc \/ Example Code<\/strong><br>1)\uae30\ubcf8SnackBar \/ Default(ContextAPI) FlmSnackBar<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\/\/ Default FlmSnackBar - Context API\uc0ac\uc6a9\nimport React from \"react\";\nimport { View, Text, Button, StyleSheet } from \"react-native\";\nimport {\n  FlmSnackBarProvider,\n  useFlmSnackBar,\n  FlmText,\n  FlmButton,\n} from \"react-native-freelifemakers-ui\";\n\nconst FlmSnackBarApp = () =&gt; {\n  const { showSnackBar } = useFlmSnackBar();\n\n  return (\n    &lt;View style={styles.content}&gt;\n      &lt;FlmText style={styles.title}&gt;SnackBar (Default)&lt;\/FlmText&gt;\n      &lt;FlmText&gt;\n        \ud30c\ub77c\uba54\ud130\uac00 \uc5c6\uc73c\uba74 info\uac00 \uae30\ubcf8 SnackBar\ud0c0\uc785\uc73c\ub85c \uc9c0\uc815\ub429\ub2c8\ub2e4.\n      &lt;\/FlmText&gt;\n      &lt;FlmText&gt;\n        If there is no parameter, the info is specified as the default snack bar\n        type.\n      &lt;\/FlmText&gt;\n      &lt;FlmButton\n        title=\"\uae30\ubcf8 SnackBar\/Default SnackBar\"\n        onPress={() =&gt; showSnackBar(\"\uae30\ubcf8 SnackBar \uba54\uc2dc\uc9c0\uc785\ub2c8\ub2e4!\")}\n      \/&gt;\n      &lt;View style={{ height: 10 }} \/&gt;\n\n      &lt;FlmButton\n        title=\"\uc778\ud3ec\uba54\uc774\uc158 SnackBar\/info SnackBar\"\n        onPress={() =&gt;\n          showSnackBar(\"\uc778\ud3ec\uba54\uc774\uc158 SnackBar\/info SnackBar\", \"info\")\n        }\n      \/&gt;\n      &lt;View style={{ height: 10 }} \/&gt;\n\n      &lt;FlmButton\n        title=\"\uc624\ub958 SnackBar \/ error SnackBar\"\n        onPress={() =&gt; showSnackBar(\"\uc624\ub958 SnackBar\/error SnackBar\", \"error\")}\n      \/&gt;\n      &lt;View style={{ height: 10 }} \/&gt;\n\n      &lt;FlmButton\n        title=\"\uc131\uacf5 SnackBar (2\ucd08) \/ success SnackBar(2s)\"\n        onPress={() =&gt;\n          showSnackBar(\n            \"\uc131\uacf5 SnackBar(2s) \/ success SnackBar(2s)\",\n            \"success\",\n            2000,\n          )\n        }\n      \/&gt;\n    &lt;\/View&gt;\n  );\n};\n\nexport default function App() {\n  return (\n    &lt;FlmSnackBarProvider&gt;\n      &lt;View style={styles.container}&gt;\n        &lt;FlmSnackBarApp \/&gt;\n      &lt;\/View&gt;\n    &lt;\/FlmSnackBarProvider&gt;\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: \"#fff\",\n    alignItems: \"center\",\n    justifyContent: \"center\",\n  },\n  content: {\n    alignItems: \"center\",\n    justifyContent: \"center\",\n    padding: 20,\n  },\n  title: {\n    fontSize: 24,\n    fontWeight: \"bold\",\n    marginBottom: 20,\n  },\n});<\/code><\/pre>\n\n\n\n<p>2)\uc0ac\uc6a9\uc790\uc815\uc758 FlmSnackBar \/ Custom FlmSnackBar<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\/\/ Custom FlmSnackBar\nimport React, {useState} from 'react';\nimport {View, Text, Button, StyleSheet} from 'react-native';\nimport {FlmSnackBar, FlmButton} from 'react-native-freelifemakers-ui';\n\nexport default function App() {\n  const &#91;showCustomSnackBar, setShowCustomSnackBar] = useState(false);\n  const &#91;snackBarMessage, setSnackBarMessage] = useState('');\n  const &#91;snackBarType, setSnackBarType] = useState('info');\n\n  const handleShowCustomSnackBar = (message, type) =&gt; {\n    setSnackBarMessage(message);\n    setSnackBarType(type);\n    setShowCustomSnackBar(true);\n  };\n\n  return (\n    &lt;View style={styles.container}&gt;\n      &lt;Text style={styles.title}&gt;\uc0ac\uc6a9\uc790\uc815\uc758 SnackBar&lt;\/Text&gt;\n      &lt;Text style={styles.title}&gt;Custom SnackBar&lt;\/Text&gt;\n      &lt;FlmButton\n        title=\"\ucee4\uc2a4\ud140 SnackBar\/Cusom SnackBar\"\n        onPress={() =&gt;\n          handleShowCustomSnackBar('\uc0ac\uc6a9\uc790 \uc815\uc758 SnackBar', 'success')\n        }\n      \/&gt;\n\n      {showCustomSnackBar &amp;&amp; (\n        &lt;FlmSnackBar\n          message={snackBarMessage}\n          type={snackBarType}\n          duration={3000} \/\/ \uc9c1\uc811 \uc2dc\uac04 \uc124\uc815(3s) \/ Set time directly (3s)\n          onHide={() =&gt; setShowCustomSnackBar(false)}\n          \/\/ \uc5ec\uae30\uc5d0 \uc6d0\ud558\ub294 \uc2a4\ud0c0\uc77c\uc744 \uc9c1\uc811 \uc8fc\uc785\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4!\n          \/\/ You can add your own desired style here!\n          style={{\n            backgroundColor: 'purple',\n            bottom: 100, \/\/ \ub354 \uc704\ub85c \uc62c\ub9bc \/ move higher\n            borderRadius: 20,\n            borderWidth: 2,\n            borderColor: 'white',\n          }}\n          textStyle={{\n            color: 'lightgreen',\n            fontWeight: 'bold',\n          }}\n        \/&gt;\n      )}\n    &lt;\/View&gt;\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: '#fff',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  title: {\n    fontSize: 24,\n    fontWeight: 'bold',\n    marginBottom: 20,\n  },\n});\n<\/code><\/pre>\n\n\n\n<p><strong>4.\uc2a4\ud06c\ub9b0\uc0f7\/ScreenShot<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"\uc2a4\ub125\ubc14\/FlmSnackBar\" width=\"473\" height=\"840\" src=\"https:\/\/www.youtube.com\/embed\/LEKQXnHxDNM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>&#8212; \uc2a4\ub0b5\ubc14\ub294 \ud1a0\uc2a4\ud2b8\uba54\uc138\uc9c0\uc640 \uc720\uc0ac\ud55c \uae30\ub2a5\uc785\ub2c8\ub2e4.Snackbar is similar to Toast Message. &#8212; \uc2a4\ud06c\ub9b0\uc0f7\/ScreenShot\uad6c\uae00\ub4dc\ub77c\uc774\ube0c\/Google Drive : https:\/\/drive.google.com\/drive\/folders\/1hhhIYmU8kSGOUTN9wd7H9igSppl6AE71?usp=drive_link 1.react-native-freelifemakers-ui NPM \ubaa8\ub4c8 \uc124\uce58\ud558\uae30 \/ react-native-freelifemakers-ui NPM Module Instal 2.\uc0ac\uc6a9\ud558\uae30 \/ Usage1)\uae30\ubcf8SnackBar \/ Default(ContextAPI) FlmSnackBar 2)\uc0ac\uc6a9\uc790\uc815\uc758 FlmSnackBar \/ Custom FlmSnackBar 3.\uc608\uc81c\ucf54\ub4dc \/ Example Code1)\uae30\ubcf8SnackBar \/ Default(ContextAPI) FlmSnackBar 2)\uc0ac\uc6a9\uc790\uc815\uc758 FlmSnackBar \/ Custom FlmSnackBar 4.\uc2a4\ud06c\ub9b0\uc0f7\/ScreenShot<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,1],"tags":[],"class_list":["post-1626","post","type-post","status-publish","format-standard","hentry","category-rnuimodule","category-uncategorized","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=1626"}],"version-history":[{"count":10,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1626\/revisions"}],"predecessor-version":[{"id":2243,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1626\/revisions\/2243"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=1626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=1626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=1626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}