{"id":1816,"date":"2025-08-13T07:42:35","date_gmt":"2025-08-13T07:42:35","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=1816"},"modified":"2025-08-13T08:51:12","modified_gmt":"2025-08-13T08:51:12","slug":"flmdrawermenu","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2025\/08\/13\/flmdrawermenu\/","title":{"rendered":"\ub4dc\ub85c\uc5b4\uba54\ub274\/FlmDrawerMenu"},"content":{"rendered":"\n<p><strong>1.react-native-freelifemakers-ui NPM \ubaa8\ub4c8 \uc124\uce58\ud558\uae30 \/ react-native-freelifemakers-ui NPM Module Install<\/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>&#8212; ReactNative CLI\uc5d0\uc11c \uc0ac\uc6a9\uc2dc\uc5d0\ub294 \ub2e4\uc74c \ubaa8\ub4c8\uc744 \ucd94\uac00\ub85c \uc124\uce58 \ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install react-native-vector-icons<\/code><\/pre>\n\n\n\n<p><strong>2.\uc0ac\uc6a9\ud558\uae30 \/ Usage<\/strong><br>1)\ubaa8\ub4c8 \ubd88\ub7ec\uc624\uae30 \/ import Module<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { FlmDrawerMenu, FlmText, FlmButton } from \"react-native-freelifemakers-ui\";<\/code><\/pre>\n\n\n\n<p>2)\uc0ac\uc6a9\ud558\uae30 \/ Usage<br>&#8212; \uae30\ubcf8 \/ Default<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      {\/* \uc608\uc81c 1: \uae30\ubcf8 \uba54\ub274 \/ Default Menu *\/}\n      &lt;FlmDrawerMenu\n        visible={isMenuVisible1}\n        onClose={() =&gt; setIsMenuVisible1(false)}\n        items={menuItems1}\n        menuHeader={menuHeader1}\n        menuDirection=\"left\"\n        menuWidth={0.7}\n      \/&gt;<\/code><\/pre>\n\n\n\n<p>&#8212; \uc0ac\uc6a9\uc790 \uc815\uc758 \/ Custom<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      {\/* \uc608\uc81c 1: \uae30\ubcf8 \uba54\ub274 \/ Default Menu *\/}\n      &lt;FlmDrawerMenu\n        visible={isMenuVisible1}\n        onClose={() =&gt; setIsMenuVisible1(false)}\n        items={menuItems1}\n        menuHeader={menuHeader1}\n        menuDirection=\"left\"\n        menuWidth={0.7}\n      \/&gt;<\/code><\/pre>\n\n\n\n<p><strong>3.\uc608\uc81c\ucf54\ub4dc \/ Example code<\/strong><br>1) Expo\uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 icon\ubaa8\ub4c8\uc744 \ubd88\ub7ec\uc635\ub2c8\ub2e4.<br>In Expo, the icon module is imported as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { Ionicons } from \"@expo\/vector-icons\";<\/code><\/pre>\n\n\n\n<p>2)ReactNative CLI\uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 icon\ubaa8\ub4c8\uc744 \ubd88\ub7ec \uc635\ub2c8\ub2e4.<br>In ReactNative CLI, the icon module is imported as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import Ionicons from 'react-native-vector-icons\/Ionicons';<\/code><\/pre>\n\n\n\n<p>3)\uc608\uc81c\ucf54\ub4dc \/ Example code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useState } from \"react\";\nimport {\n  SafeAreaView,\n  StyleSheet,\n  Text,\n  View,\n  Button,\n  Alert,\n} from \"react-native\";\n<strong>import { Ionicons } from \"@expo\/vector-icons\";<\/strong>\nimport {\n  FlmDrawerMenu,\n  FlmText,\n  FlmButton,\n} from \"react-native-freelifemakers-ui\";\n\nconst FlmDrawerMenuApp = () =&gt; {\n  const &#91;isMenuVisible1, setIsMenuVisible1] = useState(false);\n  const &#91;isMenuVisible2, setIsMenuVisible2] = useState(false);\n  \/**\n   *\n   * @param {string} label - \uc120\ud0dd\ub41c \uba54\ub274 \ud56d\ubaa9\uc758 \ub808\uc774\ube14\uc785\ub2c8\ub2e4. \/ The label of the selected menu item.\n   *\/\n\n  const selectedMenu = (label) =&gt; {\n    \/\/ \ub9e4\uac1c\ubcc0\uc218 'label' \uac12\uc744 \uc0ac\uc6a9\ud558\uc5ec Alert \uba54\uc2dc\uc9c0\ub97c \ub3d9\uc801\uc73c\ub85c \ubcc0\uacbd\ud569\ub2c8\ub2e4.\n    \/\/ Dynamically change the Alert message using the value of the parameter 'label'.\n    console.log(`\uc120\ud0dd\ub41c \uba54\ub274\/Selected Menu: ${label}`);\n    Alert.alert(\n      `${label} \uc120\ud0dd\ub428\/Selected ${label}`,\n      `${label}\uc5d0 \ub300\ud55c \ucd94\uac00 \ub85c\uc9c1\uc774 \uc2e4\ud589\ub429\ub2c8\ub2e4.\/Additional logic for ${label} will be executed.`,\n    ); \/\/ \uba54\ub274 \ud56d\ubaa9\uc744 \uc120\ud0dd\ud55c \ud6c4 \uba54\ub274\ub97c \uc790\ub3d9\uc73c\ub85c \ub2eb\uc2b5\ub2c8\ub2e4. \/ Automatically closes the menu after selecting a menu item.\n    setIsMenuVisible1(false);\n    setIsMenuVisible2(false);\n  };\n\n  \/\/ --- \uc608\uc81c 1: \uae30\ubcf8 \uc2a4\ud0c0\uc77c \uba54\ub274 ---\n  \/\/ --- Example 1: Default Style Menu ---\n  const menuItems1 = &#91;\n    {\n      label: \"\ud648\/Home\",\n      icon: &lt;Ionicons name=\"home\" size={20} color=\"#333\" \/&gt;,\n      onPress: () =&gt; selectedMenu(\"\ud648\/Home\"),\n    },\n    {\n      label: \"\ud504\ub85c\ud544\/Profile\",\n      icon: &lt;Ionicons name=\"person\" size={20} color=\"#333\" \/&gt;,\n      onPress: () =&gt; selectedMenu(\"\ud504\ub85c\ud544\/Profile\"),\n    },\n    {\n      label: \"\uc124\uc815\/Settings\",\n      icon: &lt;Ionicons name=\"settings\" size={20} color=\"#333\" \/&gt;,\n      onPress: () =&gt; selectedMenu(\"\uc124\uc815\/Settings\"),\n    },\n  ];\n\n  const menuHeader1 = (\n    &lt;View style={{ padding: 20, backgroundColor: \"#f0f0f0\" }}&gt;\n      &lt;Text style={{ fontSize: 20, fontWeight: \"bold\" }}&gt;\uae30\ubcf8 \uba54\ub274&lt;\/Text&gt;\n      &lt;Text&gt;\ud658\uc601\ud569\ub2c8\ub2e4!&lt;\/Text&gt;\n    &lt;\/View&gt;\n  );\n\n  \/\/ --- \uc608\uc81c 2: \ucee4\uc2a4\ud140 \uc2a4\ud0c0\uc77c \uba54\ub274 ---\n  \/\/ --- Example 2: Custom Style Menu ---\n  const menuItems2 = &#91;\n    {\n      label: \"\uc0c8\ub85c\uc6b4 \uc18c\uc2dd\/News\",\n      icon: &lt;Ionicons name=\"newspaper-outline\" size={22} color=\"#fff\" \/&gt;,\n      onPress: () =&gt; selectedMenu(\"\uc0c8\ub85c\uc6b4\uc18c\uc2dd\/News\"),\n    },\n    {\n      label: \"\ub0b4 \uba54\uc2dc\uc9c0\/Messages\",\n      icon: &lt;Ionicons name=\"chatbox-outline\" size={22} color=\"#fff\" \/&gt;,\n      onPress: () =&gt; selectedMenu(\"\ub0b4 \uba54\uc138\uc9c0\/Message\"),\n    },\n    {\n      label: \"\ub85c\uadf8\uc544\uc6c3\/Logout\",\n      icon: &lt;Ionicons name=\"log-out-outline\" size={22} color=\"#fff\" \/&gt;,\n      onPress: () =&gt; selectedMenu(\"\ub85c\uadf8\uc544\uc6c3\/Logout\"),\n    },\n  ];\n\n  const menuHeader2 = (\n    &lt;View\n      style={{\n        padding: 20,\n        backgroundColor: \"#1e88e5\",\n        flexDirection: \"row\",\n        alignItems: \"center\",\n      }}\n    &gt;\n      &lt;Ionicons\n        name=\"person-circle-outline\"\n        size={40}\n        color=\"#fff\"\n        style={{ marginRight: 10 }}\n      \/&gt;\n      &lt;View&gt;\n        &lt;Text style={{ fontSize: 22, fontWeight: \"bold\", color: \"#fff\" }}&gt;\n          User Name\n        &lt;\/Text&gt;\n        &lt;Text style={{ color: \"#e3f2fd\" }}&gt;user@example.com&lt;\/Text&gt;\n      &lt;\/View&gt;\n    &lt;\/View&gt;\n  );\n\n  return (\n    &lt;SafeAreaView style={styles.container}&gt;\n      &lt;Text style={styles.title}&gt;\uba54\ub274 \uc608\uc2dc\/Menu Example&lt;\/Text&gt;\n      &lt;View style={styles.buttonContainer}&gt;\n        &lt;FlmButton\n          title=\"\uae30\ubcf8 \uba54\ub274 \uc5f4\uae30\/Default Menu Open\"\n          onPress={() =&gt; setIsMenuVisible1(true)}\n          style={{ marginBottom: 10 }}\n        \/&gt;\n      &lt;\/View&gt;\n      &lt;View style={styles.buttonContainer}&gt;\n        &lt;FlmButton\n          title=\"\ucee4\uc2a4\ud140 \uba54\ub274 \uc5f4\uae30\/Cusom Menu Open\"\n          onPress={() =&gt; setIsMenuVisible2(true)}\n        \/&gt;\n      &lt;\/View&gt;\n      {\/* \uc608\uc81c 1: \uae30\ubcf8 \uba54\ub274 \/ Default Menu *\/}\n      &lt;FlmDrawerMenu\n        visible={isMenuVisible1}\n        onClose={() =&gt; setIsMenuVisible1(false)}\n        items={menuItems1}\n        menuHeader={menuHeader1}\n        menuDirection=\"left\"\n        menuWidth={0.7}\n      \/&gt;\n      {\/* \uc608\uc81c 2: \ucee4\uc2a4\ud140 \uba54\ub274 \/ Custom Menu *\/}\n      &lt;FlmDrawerMenu\n        visible={isMenuVisible2}\n        onClose={() =&gt; setIsMenuVisible2(false)}\n        items={menuItems2}\n        menuHeader={menuHeader2}\n        menuDirection=\"right\"\n        menuWidth={0.8}\n        menuContainerStyle={{ backgroundColor: \"#9370DB\" }}\n        menuItemStyle={{ borderBottomColor: \"#7555B0\", paddingVertical: 18 }}\n        itemTextStyle={{ fontSize: 18, color: \"#fff\", fontWeight: \"bold\" }}\n        overlayColor=\"rgba(33, 150, 243, 0.3)\"\n      \/&gt;\n    &lt;\/SafeAreaView&gt;\n  );\n};\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: \"center\",\n    alignItems: \"center\",\n  },\n  title: {\n    fontSize: 24,\n    marginBottom: 20,\n  },\n  buttonContainer: {\n    flexDirection: \"row\",\n    justifyContent: \"space-around\",\n    width: \"80%\",\n  },\n});\n\nexport default FlmDrawerMenuApp;\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-9-16 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"\ub4dc\ub85c\uc5b4\uba54\ub274\/FlmDrawerMenu\" width=\"473\" height=\"840\" src=\"https:\/\/www.youtube.com\/embed\/3xZZjJ6YvOQ?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>1.react-native-freelifemakers-ui NPM \ubaa8\ub4c8 \uc124\uce58\ud558\uae30 \/ react-native-freelifemakers-ui NPM Module Install &#8212; ReactNative CLI\uc5d0\uc11c \uc0ac\uc6a9\uc2dc\uc5d0\ub294 \ub2e4\uc74c \ubaa8\ub4c8\uc744 \ucd94\uac00\ub85c \uc124\uce58 \ud569\ub2c8\ub2e4. 2.\uc0ac\uc6a9\ud558\uae30 \/ Usage1)\ubaa8\ub4c8 \ubd88\ub7ec\uc624\uae30 \/ import Module 2)\uc0ac\uc6a9\ud558\uae30 \/ Usage&#8212; \uae30\ubcf8 \/ Default &#8212; \uc0ac\uc6a9\uc790 \uc815\uc758 \/ Custom 3.\uc608\uc81c\ucf54\ub4dc \/ Example code1) Expo\uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 icon\ubaa8\ub4c8\uc744 \ubd88\ub7ec\uc635\ub2c8\ub2e4.In Expo, the icon module is imported as follows: 2)ReactNative CLI\uc5d0\uc11c\ub294 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,15,1],"tags":[],"class_list":["post-1816","post","type-post","status-publish","format-standard","hentry","category-reactnative","category-rnuimodule","category-uncategorized","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1816","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=1816"}],"version-history":[{"count":19,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1816\/revisions"}],"predecessor-version":[{"id":1837,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1816\/revisions\/1837"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=1816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=1816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=1816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}