๐Ÿ‘‰ Available for use with both React Native Expo and ReactNativeCLI.

1.react-native-freelifemakers-ui NPM Module Install

npm install react-native-freelifemakers-ui

2.Usage

โœ”๏ธModule import

import { FlmButton } from "react-native-freelifemakers-ui";

โœ”๏ธExample Code

 {/* default */}
      <FlmButton
        title="Click!"
        onPress={handlePress}
      />

    {/* ์Šคํƒ€์ผ ์ถ”๊ฐ€๋ฒ„ํŠผ / Add style button */}
    <FlmButton
        title="Green Button"
        onPress={goToApp}
        style={{ backgroundColor: '#28a745', marginTop: 20 }}
        textStyle={{ fontSize: 18 }}
    />

    {/* ๋น„ํ™œ์„ฑํ™”๋œ ๋ฒ„ํŠผ / Disable Button*/}
    <FlmButton
        title="Disable Button"
        onPress={handlePress}
        disabled={true}
        style={{ marginTop: 20 }}
    />

3.Full code

import { Alert, Text, View, ScrollView, SafeAreaView } from "react-native";
import { FlmButton } from "react-native-freelifemakers-ui"; // ์‚ฌ์šฉ๋ฒ• / Usage
//import { FlmRadioGroup } from "./FlmRadioGroups";
import { Ionicons } from "@expo/vector-icons";
// useRouter ํ›… ์ž„ํฌํŠธ / Import the useRouter hook
import { useRouter } from "expo-router"; 

const handlePress = () => {
  Alert.alert("๋ฒ„ํŠผ์ด ๋ˆŒ๋ ธ์Šต๋‹ˆ๋‹ค!!/The button was pressed!!.");
};

export default function Index() {
  // useRouter ํ›…์„ ์ปดํฌ๋„ŒํŠธ์˜ ์ตœ์ƒ์œ„ ๋ ˆ๋ฒจ์—์„œ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.
  // Call the useRouter hook at the top level of the component.
  const router = useRouter();

  const handleIconButtonPress = () => {
    // ์ด์ œ router ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ™”๋ฉด ์ด๋™์„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
    // '/flmText' ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•œ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๋‹ค.
    // ์ด ๊ฒฝ๋กœ์— ํ•ด๋‹นํ•˜๋Š” ํŒŒ์ผ (์˜ˆ: app/flmText.tsx ๋˜๋Š” app/flmText.js)์ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    // Now, we'll use the router object to handle screen navigation.
    // Assuming we're navigating to the '/flmText' route.
    // There should be a file corresponding to that route, 
    // such as app/flmText.tsx or app/flmText.js.
    router.push("/flmText");
  };

  // ํ•จ์ˆ˜ ์ •์˜ ์‹œ ํŒŒ๋ผ๋ฉ”ํ„ฐ๋ฅผ ๋ฐ›๋„๋ก ๋ณ€๊ฒฝ
  // Changed the function definition to accept parameters
  const navigateToScreen = (screenName) => {
    console.log(`Navigating to: /${screenName}`);
    router.push(`/${screenName}`);
  };

  return (
    <SafeAreaView style={{ flex: 1, backgroundColor: "#f9f9f9" }}>
      <ScrollView contentContainerStyle={{ padding: 20, alignItems: "center" }}>
        <Text style={{ marginBottom: 20 }}>FlmButton Style</Text>

        {/* ๊ธฐ๋ณธ๋ฒ„ํŠผ / default button */}
        <FlmButton title="Default Button" onPress={handlePress} />

        {/* ์—ฐ๋‘์ƒ‰ ๋ฒ„ํŠผ / Green Color Button*/}
        <FlmButton
          title="Green Button"
          onPress={handlePress}
          style={{ backgroundColor: "#28a745", marginTop: 20 }}
          textStyle={{ fontSize: 18 }}
        />

        {/* ์•„์ด์ฝ˜์„ ๋ฒ„ํŠผ / icon button */}
        <FlmButton
          title="Icon Button!"
          icon={<Ionicons name="heart-outline" size={20} color="white" />}
          onPress={handleIconButtonPress} // ์ˆ˜์ •๋œ ํ•ธ๋“ค๋Ÿฌ ์—ฐ๊ฒฐ
          style={{ backgroundColor: "#FFA500", marginTop: 20 }}
        />

        {/* ๋น„ํ™œ์„ฑํ™”๋œ ๋ฒ„ํŠผ / Disable Button*/}
        <FlmButton
          title="Disable Button"
          onPress={handlePress}
          disabled={true}
          style={{ marginTop: 20 }}
        />

        {/* ์•„์ด์ฝ˜์„ ๋ฒ„ํŠผ2 / icon button */}
        <FlmButton
          title="move to FlmTextInput"
          icon={<Ionicons name="heart-outline" size={20} color="white" />}
          onPress={() => navigateToScreen("flmTextInput")} //
          style={{ backgroundColor: "#FFA500", marginTop: 20 }}
        />

        {/* ๊ธฐ๋ณธ๋ฒ„ํŠผ2 / default button2 */}
        <FlmButton
          title="move to FlmRadio"
          onPress={() => navigateToScreen("flmRadio")}
          style={{ marginTop: 20 }}
        />
        {/* ๊ธฐ๋ณธ๋ฒ„ํŠผ3 / default button3 / FlmCheckBox */}
        <FlmButton
          title="move to FlmCheckBox"
          onPress={() => navigateToScreen("flmCheckBox")}
          style={{ marginTop: 20 }}
        />
        {/* ๊ธฐ๋ณธ๋ฒ„ํŠผ3 / default button3 / FlmModal */}
        <FlmButton
          title="move to FlmModal"
          onPress={() => navigateToScreen("flmModal")}
          style={{ marginTop: 20 }}
        />
        {/* ๊ธฐ๋ณธ๋ฒ„ํŠผ4 / default button4 / FlmBottomSheet */}
        <FlmButton
          title="move to FlmBottomSheet"
          onPress={() => navigateToScreen("flmBottomSheet")}
          style={{ marginTop: 20 }}
        />
        {/* ๊ธฐ๋ณธ๋ฒ„ํŠผ5 / default button5 / FlmSnackBar - Using Context API */}
        <FlmButton
          title="move to FlmSnackBar"
          onPress={() => navigateToScreen("flmSnackBar")}
          style={{ marginTop: 20 }}
        />
        {/* ๊ธฐ๋ณธ๋ฒ„ํŠผ6 / default button6 / FlmSnackBar - Custom */}
        <FlmButton
          title="move to FlmSnackBar Custom"
          onPress={() => navigateToScreen("flmSnackBarCustom")}
          style={{ marginTop: 20 }}
        />
        {/* ๊ธฐ๋ณธ๋ฒ„ํŠผ7 / default button7 / FlmSearchBar #007bff #9370DB*/}
        <FlmButton
          title="move to FlmSearchBar Custom"
          onPress={() => navigateToScreen("flmSearchBar")}
          style={{ backgroundColor: "#F44336", marginTop: 20 }}
        />
      </ScrollView>
    </SafeAreaView>
  );
}

4.ScreenShot

FlmButton.jpg