๐Ÿ‘‰A modal is a UI container that overlays the screen and blocks user interaction,

directing focus to a single task or piece of information.

It is commonly used for user login, password input, image zooming, and similar interactions.

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

npm install react-native-freelifemakers-ui

2.Usage

โœ”๏ธOpens a modal when the button is clicked.

import {FlmModal, FlmButton, FlmText} from 'react-native-freelifemakers-ui';

          <FlmButton
            title="๊ธฐ๋ณธ ๋ชจ๋‹ฌ ์—ด๊ธฐ/Open Default Modal"
            onPress={() => setModal1Visible(true)}
          />
          <FlmModal
            isVisible={isModal1Visible}
            onClose={() => setModal1Visible(false)}
            title="๊ธฐ๋ณธ ๋ชจ๋‹ฌ/Default Modal"
            message="์•„๋ฌด๋Ÿฐ ์ปค์Šคํ…€ ์Šคํƒ€์ผ์ด ์ ์šฉ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
            /No custom styles were applied."
            animationDirection="slideUp"
          />

3.Full Code

import React, { useState } from "react";
import { View, StyleSheet, SafeAreaView, ScrollView } from "react-native";
import { FlmModal, FlmButton, FlmText } from "react-native-freelifemakers-ui";

export default function FlmModalApp() {
  const [isModal1Visible, setModal1Visible] = useState(false);
  const [isModal2Visible, setModal2Visible] = useState(false);
  // ์ปค์Šคํ…€ ์Šคํƒ€์ผ ์ ์šฉ / Apply custom style
  const [isModal3Visible, setModal3Visible] = useState(false); 
  // ๋‹ค๋ฅธ ์ปค์Šคํ…€ ์Šคํƒ€์ผ / Apply another custom style
  const [isModal4Visible, setModal4Visible] = useState(false); 

  return (
    <SafeAreaView style={appStyles.safeArea}>
      <ScrollView style={appStyles.scrollViewContent}>
        <View style={appStyles.section}>
          <FlmText style={appStyles.header}>FlmModal ์ปค์Šคํ„ฐ๋งˆ์ด์ง• ์˜ˆ์‹œ</FlmText>

          {/* --- 1. ๊ธฐ๋ณธ ์Šฌ๋ผ์ด๋“œ ๋ชจ๋‹ฌ / Default Slide Modal
              -- 'slideUp', 'slideDown', 'slideLeft', 'slideRight', 
              'fade', 'none' --- */}
          <FlmText>
            1. ๊ธฐ๋ณธ ์Šฌ๋ผ์ด๋“œ ๋ชจ๋‹ฌ / Default --
            slideUp,slideDown,slideLeft,slideRight, fade, none
          </FlmText>
          <FlmButton
            title="๊ธฐ๋ณธ ๋ชจ๋‹ฌ ์—ด๊ธฐ/Open Default Modal"
            onPress={() => setModal1Visible(true)}
          />
          <FlmModal
            isVisible={isModal1Visible}
            onClose={() => setModal1Visible(false)}
            title="๊ธฐ๋ณธ ๋ชจ๋‹ฌ/Default Modal"
            message="์•„๋ฌด๋Ÿฐ ์ปค์Šคํ…€ ์Šคํƒ€์ผ์ด ์ ์šฉ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
				            /No custom styles were applied."
            animationDirection="slideUp"
          />
          <FlmText>2. ์ปค์Šคํ…€ ๋ชจ๋‹ฌ/Custom Modal</FlmText>
          {/* --- 2. ๋ฐฐ๊ฒฝ์ƒ‰, ํˆฌ๋ช…๋„ ๋ณ€๊ฒฝ ๋ชจ๋‹ฌ /
            Modal to change background color and transparency --- */}
          <View style={{ marginTop: 20 }}>
            <FlmButton
              title="๋ฐฐ๊ฒฝ ์ปค์Šคํ…€ ๋ชจ๋‹ฌ ์—ด๊ธฐ/Background Custom Modal"
              onPress={() => setModal2Visible(true)}
            />
          </View>
          <FlmModal
            isVisible={isModal2Visible}
            onClose={() => setModal2Visible(false)}
            title="๋ฐฐ๊ฒฝ ์ปค์Šคํ…€/Background Custom"
            message="๋ฐฐ๊ฒฝ์ด ํŒŒ๋ž€์ƒ‰ ๋ฐ˜ํˆฌ๋ช…์œผ๋กœ ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
				    /The background has been changed to a blue, translucent color."
            animationDirection="fade"
            
            // ํŒŒ๋ž€์ƒ‰ ๋ฐ˜ํˆฌ๋ช… ๋ฐฐ๊ฒฝ / Blue translucent background
            backdropColor="rgba(0,0,255,0.3)" 
          />

          {/* --- 3. ๋ชจ๋‹ฌ ์ปจํ…์ธ  ์Šคํƒ€์ผ ๋ณ€๊ฒฝ ๋ชจ๋‹ฌ /
            Modal content style change modal --- */}
          <View style={{ marginTop: 20 }}>
            <FlmButton
              title="์ปจํ…์ธ  ์Šคํƒ€์ผ ์ปค์Šคํ…€ ๋ชจ๋‹ฌ ์—ด๊ธฐ
              /Open custom modal with content style"
              onPress={() => setModal3Visible(true)}
            />
          </View>
          <FlmModal
            isVisible={isModal3Visible}
            onClose={() => setModal3Visible(false)}
            title="์ปจํ…์ธ  ์ปค์Šคํ…€/Content customization"
            message="๋ชจ๋‹ฌ ์ปจํ…์ธ  ๋ฐ•์Šค์˜ ๋ชจ์–‘์ด ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
            /The appearance of the modal content box has changed."
            animationDirection="slideRight"
            modalContentStyle={{
              backgroundColor: "#FFF0F5", // ์—ฐํ•œ ๋ถ„ํ™์ƒ‰ / Light pink
              borderRadius: 5, // ๋œ ๋‘ฅ๊ทผ ๋ชจ์„œ๋ฆฌ / Less rounded corners
              borderWidth: 2, // ํ…Œ๋‘๋ฆฌ ์ถ”๊ฐ€ / Add border
              borderColor: "#FF69B4", // ํ•‘ํฌ์ƒ‰ ํ…Œ๋‘๋ฆฌ / Pink border
              padding: 10, // ํŒจ๋”ฉ ์กฐ์ ˆ / padding adjustment
            }}
            titleStyle={{
              color: "#FF69B4", // ํ•‘ํฌ์ƒ‰ ์ œ๋ชฉ / Pink Color Title
              fontSize: 25,
              fontWeight: "normal",
            }}
            messageStyle={{
              color: "#8B008B", // ๋ณด๋ผ์ƒ‰ ๋ฉ”์‹œ์ง€ / Pupple Color Message
              fontStyle: "italic",
            }}
          >
            <FlmText>
              ์—ฌ๊ธฐ์— ์ถ”๊ฐ€์ ์ธ ์ปค์Šคํ…€ ๋‚ด์šฉ์ด ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!/Additional
              custom content can be added here!
            </FlmText>
          </FlmModal>

          {/* --- 4. ๋‹ค์–‘ํ•œ ์Šคํƒ€์ผ ์„ž๊ธฐ / Mix different styles --- */}
          <View style={{ marginTop: 20 }}>
            <FlmButton
              title="๋‹ค์–‘ํ•œ ์Šคํƒ€์ผ ์„ž๊ธฐ/Mix different styles"
              onPress={() => setModal4Visible(true)}
            />
          </View>
          <FlmModal
            isVisible={isModal4Visible}
            onClose={() => setModal4Visible(false)}
            title="MIXED STYLE!"
            message="๋ฐฐ๊ฒฝ, ์ปจํ…์ธ , ํ…์ŠคํŠธ ์Šคํƒ€์ผ์ด ๋ชจ๋‘ ์ปค์Šคํ…€๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
            /Background, content, and text styles are all customized."
            animationDirection="slideDown"
            animationDuration={500} // ์• ๋‹ˆ๋ฉ”์ด์…˜ ์‹œ๊ฐ„๋„ ์กฐ์ ˆ / Adjust animation time
            // ์ฃผํ™ฉ์ƒ‰ ๋ฐ˜ํˆฌ๋ช… ๋ฐฐ๊ฒฝ / Orange translucent background
            backdropColor="rgba(255,165,0,0.4)" 
            modalContentStyle={{
              backgroundColor: "#E0FFFF", // ์—ฐํ•œ ํ•˜๋Š˜์ƒ‰ / light sky blue
              borderRadius: 30, // ๋” ๋‘ฅ๊ทผ ๋ชจ์„œ๋ฆฌ / more rounded corners
              shadowColor: "#000",
              shadowOffset: { width: 0, height: 4 },
              shadowOpacity: 0.3,
              shadowRadius: 5,
              elevation: 8,
            }}
            titleStyle={{
              color: "#4682B4", // ์Šคํ‹ธ๋ธ”๋ฃจ ์ œ๋ชฉ / steel blue title
              textDecorationLine: "underline",
            }}
            messageStyle={{
            // ์–ด๋‘์šด ์Šฌ๋ ˆ์ดํŠธ ๊ทธ๋ ˆ์ด ๋ฉ”์‹œ์ง€ / Dark slate grey message
              color: "#2F4F4F", 
              lineHeight: 24,
            }}
          />
        </View>
      </ScrollView>
    </SafeAreaView>
  );
}

const appStyles = StyleSheet.create({
  safeArea: {
    flex: 1,
    backgroundColor: "#f0f2f5",
  },
  scrollViewContent: {
    padding: 20,
  },
  header: {
    // ์‚ญ์ œ์˜ˆ์ •
    fontSize: 24,
    fontWeight: "bold",
    marginBottom: 30,
    color: "#333",
    textAlign: "center",
  },
  section: {
    marginBottom: 30,
    padding: 15,
    backgroundColor: "#fff",
    borderRadius: 10,
    shadowColor: "#000",
    shadowOffset: { width: 0, height: 2 },
    shadowOpacity: 0.1,
    shadowRadius: 3,
    elevation: 5,
  },
  customChildrenText: {
    //์‚ญ์ œ์˜ˆ์ •
    fontSize: 14,
    color: "#333",
    marginTop: 10,
    marginBottom: 15,
    textAlign: "center",
    fontStyle: "italic",
  },
});

3.ScreenShot

https://youtube.com/shorts/ycFyJC9O68U?feature=share