1.0.5-0.1 • Published 2 days ago

react-native-router-screen v1.0.5-0.1

Weekly downloads
-
License
-
Repository
github
Last release
2 days ago

react-native-router-screen

Version npm

Npm install

npm i react-native-router-screen

NB: Close the project and start anew

Example

Import

import { NavigationContainer,RenderScreen, useRouter, useNavigation,useParamsScreenProps, DrawerContainer, userDrawer, useTheme} from 'react-native-router-screen';

import {
  Checkbox,Link,Pagination,PressableButton,Ratings,StyledText,Toast,Input,TouchableOpacityButton} from 'react-native-router-screen'

How Setup it

Wrap the whole project with NavigationContainer

PropertyDescription
schemeAn optional string with dark and default. Default default
themeAn optional object with dark and default themes.
- darkAn optional property for the dark theme.
- defaultAn optional property for the default theme.
basePathA required string representing the base path or URL.
childrenA required prop for passing child React elements.
configAn optional prop for passing child React elements.
ConfigurationType
homeNavbarReact.JSX.Element`
navbarReact.JSX.Element`
footerReact.JSX.Element`

Example Navbar

homeNavbar

import and use. | Property | Type | Description | |-------------|--------------------|----------------------------------------------------------------------| | title | string | The title to be displayed in the main navigation bar. | | children | React.ReactNode | (Optional) Additional React elements that can be included in the main navigation bar. |

const MainNavbar = ({ title }) => {
    const { colors } = useTheme();

    const styles = StyleSheet.create({
        navbar: {
            display: 'flex',
            backgroundColor: colors.primary,
            flexDirection: 'row',
            alignItems: 'center',
            width: '100%',
            justifyContent: 'space-between',
            color: 'black',
            height: 64,
            paddingHorizontal: 10,
            alignContent: 'space-between',

            shadowColor: "#000",
            shadowOffset: {
                width: 0,
                height: 1,
            },
            shadowOpacity: 0.15,
            shadowRadius: 1.00,
            elevation: 3,
        },
        navbar_button: {
            padding: 8,
        },
    });

    return (
        <View style={styles.navbar}>
            <View>
                <Text style={{
                    fontSize: 24,
                    fontWeight: '600',
                    color: colors.primary_text
                }}>
                    {title}
                </Text>
            </View>

            <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 8 }}>
                {/* 
        <View>
          <Pressable onPress={() => setIsVisible(true)}>
            <View
              style={styles.navbar_button}
            >
              <Image
                source={assets_images.search_white}
                style={{ height: 28, width: 28 }}
              />
            </View>
          </Pressable>
        </View> */}
            </View>
        </View>
    );
};

export default MainNavbar;

navbar

import and use. | Property | Type | Description | |-------------------|-----------------------------------------|-------------------------------------------------------------------------------------| | title | string | The title to be displayed in the navbar. | | clickAbleFunction| () => void | (Optional) Function to be executed when the title is clicked. | | style | ViewStyle or TextStyle or ImageStyle or object | (Optional) Style object or React Native style type to customize the appearance of the title component. | | children | React.ReactNode | (Optional) Additional React elements that can be included as children of the title component. |

const NavbarTitleBackButton = ({
    title,
    clickAbleFunction,
    style,
    children
}: {
    title: string
    backward: string,
    clickAbleFunction?: () => void,
    children?: React.ReactNode,
    style?: ViewStyle | TextStyle | ImageStyle | object,
}) => {
    const { push, history, basePath } = useRouter()
    const { colors, dark } = useTheme()

    const styles = StyleSheet.create({
        navbar: {
            paddingHorizontal: 20,
            display: 'flex',
            backgroundColor: colors.card,
            flexDirection: 'row',
            alignItems: 'center',
            width: '100%',
            justifyContent: 'space-between',
            color: 'black',
            height: 64,
            paddingLeft: 10,
            paddingRight: 10,
            alignContent: 'space-between',

            shadowColor: "#000",
            shadowOffset: {
                width: 0,
                height: 1,
            },
            shadowOpacity: 0.15,
            shadowRadius: 1.00,
            elevation: 3,

        },
        navbar_button: {
            padding: 8,
        },
    });
    return (
        <View style={[styles.navbar, style]}>
            {/* <Image source={{ uri: svgBase64 }} /> */}
            <View>
                <TouchableOpacityButton
                    key={title}
                    imageStyle={{
                        width: 24,
                        height: 24,
                    }}
                    onPress={() => {
                        if (clickAbleFunction) {
                            clickAbleFunction()
                        }
                        else {
                            if (history.get().length) {
                                history.back()
                            }
                            else {
                                push(basePath)
                            }
                        }
                    }}
                    image={assets_images.arrow_left_indicate}
                    containerStyle={{
                        backgroundColor: 'transparent',
                        width: 36,
                        height: 36,
                        borderWidth: 0,
                    }}
                />
            </View>
            <View style={{
                flex: 1,
                alignItems: 'center',
                left: children ? 0 : -18
            }}>
                <StyledText
                    style={
                        [
                            global_styles.text_xl,
                            global_styles.font_bold,
                            {
                                color: colors.primary
                            }
                        ]
                    }
                >
                    {
                        title
                    }
                </StyledText>
            </View>
            <View>
                {
                    children
                }
            </View>

        </View>
    );
};

export default NavbarTitleBackButton;

Footer

import { Image, Pressable, StyleSheet, View } from 'react-native';
import { StyledText, useRouter, useTheme } from 'react-native-router-screen';
import { assets_images } from '../../assets/assets_images';
import { useTranslate } from '../../context/TranslateContext';
import navigate_link from '../../navigate_link';


export default function Footer() {
    const router = useRouter();
    const { colors, dark } = useTheme()
    const { wishlist, home, cart, shopping, profile } = useTranslate()
    const footerMenuButton = [
        {
            select: assets_images.home_primary,
            default: assets_images.home,
            title: home,
            link: navigate_link.home,
        },
        {
            select: assets_images.shopping_primary,
            default: assets_images.shopping,
            title: shopping,
            link: navigate_link.shopping
        },
        {
            select: assets_images.wishlist_primary,
            default: assets_images.wishlist,
            title: wishlist,
            link: navigate_link.wishlists
        },
        {
            select: assets_images.carts_primary,
            default: assets_images.carts,
            title: cart,
            link: navigate_link.carts
        },
        {
            select: assets_images.profile_primary,
            default: assets_images.profile,
            title: profile,
            link: navigate_link.account
        }
    ]
    const styles = StyleSheet.create({
        footer: {
            backgroundColor: colors.card,
            // borderTopEndRadius: 20,
            // borderTopStartRadius: 20,
            padding: 16,
            paddingHorizontal: 20,
            display: 'flex',
            flexDirection: 'row',
            justifyContent: 'space-between',
            alignItems: 'center',
            borderColor: colors.border,
            borderWidth: 0.5,
            shadowColor: "#000",
            height: 64,
            width: '100%',
        },
        button: {
            gap: 2,
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'space-between',
            flexDirection: 'column',
            height: 48,
            minWidth: 48,
            padding: 4,
        },
        buttonGPlusStyle: {
            flexDirection: 'row',
            alignItems: 'center',
            backgroundColor: '#dc4e41',
            borderWidth: 0.5,
            borderColor: '#fff',
            height: 40,
            borderRadius: 5,
            margin: 5,
        },
        buttonFacebookStyle: {
            flexDirection: 'row',
            alignItems: 'center',
            backgroundColor: '#485a96',
            borderWidth: 0.5,
            borderColor: '#fff',
            height: 40,
            borderRadius: 5,
            margin: 5,
        },
        buttonImageIconStyle: {
            padding: 10,
            margin: 5,
            height: 25,
            width: 25,
            resizeMode: 'stretch',
        },
        buttonTextStyle: {
            color: '#fff',
            marginBottom: 4,
            marginLeft: 10,
        },
        buttonIconSeparatorStyle: {
            backgroundColor: '#fff',
            width: 1,
            height: 40,
        },
    });
    return (
        <View style={styles.footer}>
            {
                footerMenuButton?.map((r, index) => {
                    const check = router.path === r.link;
                    return (
                        <View key={index}>
                            <Pressable
                                // style={{
                                //     paddingVertical: 10,
                                //     paddingHorizontal: 4
                                // }}
                                // underlayColor={colors?.background}
                                onPress={() => router.push(r?.link)}
                                disabled={check}
                            >
                                <View style={styles.button}>
                                    <View>
                                        <Image
                                            source={
                                                check ? r?.select : r?.default
                                            }
                                            style={{
                                                height: 24, width: 24, objectFit: 'contain',
                                            }}
                                        />
                                    </View>
                                    <StyledText style={{
                                        fontSize: 10,
                                        color: check ? colors?.primary : colors.grey
                                    }}>
                                        {
                                            r?.title
                                        }
                                    </StyledText>
                                </View>
                            </Pressable>
                        </View>
                    )
                })
            }

        </View>
    );
}
const theme = {
  dark: {
    background: 'red'
  },
  default: {
    background: 'green',
    primary: 'gold'
  }
}

function App(): JSX.Element {
  const [isDarkTheme, setDarkTheme] = useState<boolean>(false);

  return (
    <NavigationContainer
      scheme={isDarkTheme ? 'dark' : 'default'}
      // scheme={scheme !== 'dark' ? 'dark' : 'default'}
      basePath={home_path}
      config={{
        footer: <Footer />
      }}
    >
      <WrapScreen />
    </NavigationContainer>
  );
}

WrapScreen:

const WrapScreen = () => {
  const { dark, colors } = useTheme();
  return (
    <AuthenticationCheckProvider>
      <TranslateProvider>
        <DrawerContainer>
          <StatusBar
            animated={true}
            barStyle={dark ? "light-content" : 'dark-content'}
            backgroundColor={colors.card}
            showHideTransition={'slide'}
            hidden={false}
          />
          <Screen />
        </DrawerContainer>
      </TranslateProvider>
    </AuthenticationCheckProvider>

  )
}

Drawer

Wrap the whole project with DrawerContainer

function App(): JSX.Element {
  return (
    <NavigationContainer
      theme={theme}
      basePath='/home'
    >
      <DrawerContainer>
        <StatusBar
          animated={true}
          barStyle='light-content'
          backgroundColor={colors.primary}
          showHideTransition={'slide'}
          hidden={false}
        />
        <Screen />
      </DrawerContainer>
    </NavigationContainer>
  );
}

props: | Property | Description | | ------------------- | ------------------------------------------------ | | drawerConfig | Configuration for a drawer component. | | drawerWidth | The width of the drawer . Default 300 | | drawerPosition | The position of the drawer (left, right, or undefined). Default left | | renderNavigationView | Content to render inside the drawer. |

How to use drawer and deferent content

<Render.screen
        title='home'
        drawerConfig={{
          drawerPosition: 'left',
          drawerWidth: 300,
          renderNavigationView: <DrawerHome/>
        }}
        hasFooter={true}
        path='/home'
        screen={HomeScreen}
/>

Note: If you use the navigation drawer in the parent container it will nest in all pages. If you don't want to see any screen then follow the example below

<Render.screen
        title='home'
        drawerConfig={{
          renderNavigationView: undefined
        }}
        hasFooter={true}
        path='/home'
        screen={HomeScreen}
/>

Or if you want to add it manually inside the screen component

const Home = (props: ScreenProps) => {
  const router = useRouter()
    const drawer = userDrawer()
    useEffect(() => {
      drawer.setDrawerConfig({
        renderNavigationView: <HomeDrawer />
      })
    }, [])
  return (
    <View>
      <Text>
        Home
      </Text>
      <Link href='/about'>
        About
      </Link>
      <Button
        title='Home'
        onPress={() => {
          router.push('/settings/435345')
        }}
      />
    </View>
  )
}
PropertyTypeDescription
loadingComponentbooleanRepresents whether a loading component should be displayed.
setTitle(title: string) => voidFunction to set the title of the component or page.
setLoadingComponentReact.Dispatch<React.SetStateAction<boolean>>Setter function for updating the loadingComponent state.
customDynamicNavbarReact.ReactNodeCustom React node representing a dynamic navigation bar.
setCustomDynamicNavbarReact.Dispatch<React.SetStateAction<React.ReactNode>>Setter function for updating the customDynamicNavbar state.
params{ [key: string]: any }An object containing key-value pairs for additional parameters.

Open drawer handler

  const {drawerRef} = userDrawer()
  const openDrawer = () => {
        return drawerRef.current?.openDrawer()
    }

Close drawer handler

  const {drawerRef} = userDrawer()
  const closeDrawer = () => {
        return drawerRef.current?.closeDrawer()
    }

Theme color

Here's a breakdown of the themeColorNameProps type properties and their descriptions:

  • primary: The primary color used for elements like buttons and highlighting.
  • background: The background color of the UI.
  • card: The color of cards or containers in the UI.
  • text: The text color.
  • link: The color used for hyperlinks or links.
  • border: The color of borders and separators.
  • notification: The color used for notifications or alerts.
  • transparent: A transparent color.
  • primary_text: The text color for primary elements.
  • secondary: A secondary color for elements like secondary buttons.
  • secondary_text: The text color for secondary elements.
  • success: The color used to indicate success.
  • success_text: The text color for success messages.
  • danger: The color used to indicate danger or errors.
  • danger_text: The text color for error messages.
  • warning: The color used to indicate warnings.
  • warning_text: The text color for warning messages.
  • info: The color used for informational messages.
  • info_text: The text color for informational messages.
  • grey: A general grey color.
  • light_grey: A lighter shade of grey.
  • dark_grey: A darker shade of grey.

Using the operating system preferences

import { useColorScheme } from 'react-native';

function App(): JSX.Element {
  const scheme = useColorScheme();
  return (
    <NavigationContainer
      theme={theme}
      scheme={scheme == 'dark' ? 'dark' : 'default'}
      basePath='/home'
    >
      <DrawerContainer   >
        <StatusBar
          animated={true}
          barStyle='light-content'
          backgroundColor={colors.primary}
          showHideTransition={'slide'}
          hidden={false}
        />
        <N />
      </DrawerContainer>
    </NavigationContainer>
  );
}

Add Screen

Import the RenderScreen class and declare it in a new variable using the new keyword

  const Render = new RenderScreen()
function Screen(): JSX.Element {
  const Render = new RenderScreen()
  return (
    <Render.Render>
          <Render.screen
            path={'/home'}
            title='Home'
            navbar={<Navbar/>}
            // hasNavbar={true}
            isPrivate={true}
            privateState={true}
            screen={Home}
          />

          <Render.screen
            title='Settings'
            // hasNavbar={true}
            path={'/settings'}
            screen={Settings}
          />
          <Render.screen
            title='About'
            // hasNavbar={true}
            path={'/about'}
            screen={About}
          />
    </Render.Render>
  );
}

How loading component work in screen

function SignUpScreen(props: ScreenProps) {
    const router = useRouter()
    const translate = useTranslate()
    const { colors } = useTheme()
    const { push, history, basePath } = useRouter()

    const { isLoading, refetch, role, isLoggedIn, user_info } = useAuth();

    useEffect(() => {
        if (isLoggedIn) {
            props.setLoadingComponent(true)
            setTimeout(() => {
                history.back()
                props.setLoadingComponent(false)
            }, 100);
        }
        else {
            props.setLoadingComponent(false)
        }
        return () => {
        }
    }, [isLoading, isLoggedIn, refetch])

    const {
        sign_in,
        password_error,
        sign_up,
        password,
        name,
     } = translate

    const [loading, setLoading] = useState(false);
    const [error, setError] = useState<string>()

    const signupHandle = async () => {
       
    }

    return (
        <ScrollView>
          //-----------------------------------------------
          //-----------------------------------------------
          //-----------------------------------------------
          //-----------------------------------------------
          //-----------------------------------------------
        </ScrollView>
    );
}

export default SignUpScreen;
export const translate = {
   en: {
        incomplete_order_message: "You have an incomplete order.",
        view_order: "View order",
        discount_high_to_low: "Discount: high to low",
        discount_low_to_high: "Discount: low to high",
        price_high_to_low: "Price: High to low",
        price_low_to_high: "Price: Low to high",
    },
    bn:{
      // ---------------------------------
      // ---------------------------------
      // ---------------------------------
      // ---------------------------------
      // ---------------------------------
    },
    in:{
      // ------------------------------------
      // ------------------------------------
      // ------------------------------------
      // ------------------------------------
      // ------------------------------------
    }
}
import React, { useContext, createContext } from 'react';
import { translate, TranslateInterface } from './translate'

const TranslateContext = createContext<TranslateInterface>(translate.bn)
function TranslateProvider({ children }: { children: React.ReactNode }) {
    const bn = translate.bn
    return (
        <TranslateContext.Provider value={bn}>
            {
                children
            }
        </TranslateContext.Provider>
    );
}
export function useTranslate() {
    const translate: TranslateInterface = useContext(TranslateContext);
    return translate
}
export default TranslateProvider;

pass parameter:

PropertyDescription
pathA string representing a path or identifier for the component.
screenA function that takes props and returns a React element. Used to define the content or component to be rendered in the screen.
titleA string representing the title or heading for the component.
navbar(Optional) A function that renders a navigation bar or header component. It takes props and returns a React element. Default: Prebuilt navbar
footer(Optional) A function for rendering a footer component. It takes props and returns a React element.
isPrivateA boolean flag that may indicate whether this component requires authentication or authorization to access. It can be used to control access to the component.
privateStateA boolean flag that represents the private state of the component. It could be used to determine if the user is currently authenticated or authorized to access the component.
hasFooterA boolean flag that controls whether the component should include a footer. It can be used to toggle the presence of a footer.
hasNavbarA boolean flag that controls whether the component should include a navigation bar or header. It can be used to toggle the presence of a navigation bar.
drawerConfigDrawer configure

How to Create a 404 screen

Use at the end:

      <Render.screen
        title='Not Found'
        hasFooter={true}
        hasNavbar={true}
        path='*'
        screen={NotFound}
      />

How to redirect to other

export default function NotFound(props: ScreenProps) {
    const router = useRouter();
    const navigation = useNavigation()
    useEffect(() => {
        navigation.setLoadingComponent(true)
        router.push('/home')
        navigation.setLoadingComponent(false)
        return () => {
        }
    }, [])

    return (
        <View>
        </View>
    )
}
const Home = (props: ScreenProps) => {
  const router = useRouter()
  return (
    <View>
      <Text>
        Home
      </Text>
      <Link href='/about'>
        About
      </Link>
      <Button
        title='Home'
        onPress={() => {
          router.push('/settings/435345')
        }}
      />
    </View>
  )
}

Dynamic screen

const Navigate = () => {
  const Render = new RenderScreen();
  const navigation = useNavigation();
  const params = useParams()
  const searchparams = useSearchparams()
  return (
    <Render.Render>
      <Render.screen
        title='home'
        // hasNavbar={true}
        path='/settings/:settingID'
        screen={Settings}
      />
      <Render.screen
        title='home'
        // hasNavbar={true}
        path={'/blog/:blogID/:title'}
        screen={About}
      />
    </Render.Render>
  )
}

Note: Avoid using slashes at the end of path

Bad/not working: /blog/:blogID/:title/ Use: /blog/:blogID/:title

Params

const params = useParams()
 const Home = (props: ScreenProps) => {
  const params = props?.params;
  console.log(params)
  const router = useRouter()
  return (
    <View>
      <Text>
        Home
      </Text>
      <Link href="/settings/435345?search=5435&query=45435&done=true#done">
        Settings
      </Link>
      <Button
        title='Settings'
        onPress={() => {
          router.push('/settings/435345?search=5435&query=45435&done=true#done')
        }}
      />
    </View>
  )
}
{
  blogID:53455,
  title:"Title"
}
PropertyDetails
keyKeys of type string.
valuesValues of type string or number.

Screen component props

PropertyDetails
loadingComponentIndicates whether a loading component is displayed.
setLoadingComponentFunction to set the loading component state.
customDynamicNavbarCustom dynamic navigation bar component.
setCustomDynamicNavbarFunction to set the custom dynamic navbar component.
paramsParameters for the screen.

Router properties

  const router = useRouter()
  console.log(router)
navigate a link
 const Home = (props: ScreenProps) => {
  const params = props?.params
  const router = useRouter()
  return (
    <View>
      <Text>
        Home
      </Text>
      <Link href="/settings/435345?search=5435&query=45435&done=true#done">
        Settings
      </Link>
      <Button
        title='Settings'
        onPress={() => {
          router.push('/settings/435345?search=5435&query=45435&done=true#done')
        }}
      />
    </View>
  )
}

Searchparams

  const router = useRouter()
  const searchparams = router?.query

with query: https://example.com/path?name=Branch&product=5345 | Property | Details | |----------------|--------------------------------------| | key | Keys of type string. | | values | Values of type string or number. |

Note: Avoid using slashes at the end of link/url

Bad/not working: /settings/435345/?search=5435&query=45435&done=true#done Use: /settings/435345?search=5435&query=45435&done=true#done

PropertyDescription
pathA string or null representing the path.
basePathA string representing the base path.
hashA string or null representing the hash.
protocolA string or null representing the protocol.
asPathA string representing the asPath.
originA string or null representing the origin.
usernameA string or null representing the username.
passwordA string or null representing the password.
hostnameA string or null representing the hostname.
portA string or null representing the port.
queryAn object with keys as strings and values of any type.
pushA function for navigating with options, returning a promise.
historyAn object with methods for navigating history and retrieving history stack.
titleCurrent screen title

Navigation Provider

 const navigation = useNavigation();

Navigation properties:

PropertyDetails
loadingComponentIndicates whether a loading component is displayed.
setLoadingComponentFunction to set the loading component state.
customDynamicNavbarCustom dynamic navigation bar component.
setCustomDynamicNavbarFunction to set the custom dynamic navbar component.

Modal

https://reactnative.dev/docs/modal

Components

  • StyledText
  • PressableButton
  • TouchableOpacityButton
  • Link
  • checkbox
  • input
  • Toast
  • Ratings
  • Pagination
  • Dropdown picker

StyledText

<StyledText>
        Home
</StyledText>
PropertyDescription
childrenChild elements or content to be rendered.
style (optional)Styling information for the component.
numberOfLines (optional) Number of lines to limit the content (used in text components).

PressableButton or TouchableOpacityButton

    <PressableButton onPress={()=>{}} text={'Home'} />
PropertyDescription
text (optional)The text or label to be displayed on the button.
onPress (optional)A function to be executed when the button is pressed.
disableStyle (optional)Styling for the button when it's disabled.
containerStyle (optional)Additional container style for the button.
disabled (optional)If true, the button is in a disabled state.
image (optional)An image component or source to be displayed on the button.
image_url (optional)URL or source for the image to be displayed on the button.
imageStyle (optional)Styling for the image component.
textStyle (optional)Styling for the text on the button.

These descriptions provide a detailed explanation of each property, its data type, and the role it plays in the buttonPropsType type definition. You can use this table to better understand the purpose of each property and how to use them in your code or documentation.

Link

     <Link href='/path?name=Branch&products=[Journeys,Email,Universal%20Ads]'>
        lorem
      </Link>
Property Description
hrefThe URL or link destination.
childrenChild elements or content to be displayed as the link text.
style (optional)Styling information for the link.

Checkbox

 <Checkbox isChecked={isChecked} setChecked={setChecked}/>
PropertyDescription
isCheckedIndicates whether the checkbox is checked.
setCheckedA function to update the isChecked state.
style (optional)Styling information for the checkbox.
asset (optional)Defines assets for the checked and unchecked image.

Ratings

<Ratings rating={10} size={10} />
PropertyDescription
size (optional)Specifies the size of the component.
ratingRepresents the rating value.
asset (optional)Defines assets for the filled and empty image.

Toast

  Toast({ text: noResultsFoundPlaceholder })
PropertyDescription
type (optional)Specifies the type of the component.
textContains the text content.

Input

 <Input
          setValue={setEmail}
          value={email}
          placeholder={"emailTr"}
          toast={"email_error"}
          pattern={/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}
        />
PropertyDescription
autoFocus (optional)Determines if the input should receive focus automatically.
containerStyle (optional)Styling information for the container of the input.
style (optional)Styling information for the input component.
asset (optional)Specifies an asset associated with the input.
valueContains the current value of the input.
multiline (optional)Indicates if the input allows multiple lines of text.
setValueA function to set or update the input value.
defaultValue (optional)Provides a default value for the input.
placeholder (optional)Displays a placeholder text in the input field.
pattern (optional)Defines a regular expression pattern for input validation.
toast (optional)A message or toast to display as feedback for the input.
type (optional)password or text

Pagination

 <Pagination
        currentPage={10}
        getLastPage={100} pageHandle={() => { }}
        disableButton={{
          bg: 'red',
          text: 'white'
        }}
        button={{
          bg: 'gold',
          text: "white",
          borderWidth: 1,
          borderColor: 'red',
        }}
      />
PropertyDescription
disableButton (optional)Configurations for a disabled button.
button (optional)Configurations for an enabled button.
pageHandleA function or handler for page management.
currentPageRepresents the current page or state.
getLastPageA function or handler to retrieve the last page.

Dropdown picker

<View>
        <DropDownPicker
          multipleConfig={{
            hasMultiple: true,
            storeValue: storeValue,
            resetTitle: "Reset",
            selectedTitle: "Selected",
            setStoreValue: setStoreValue
          }}

          items={[
            { label: '4545', value: "FFFFFFsFF" },
            { label: '4545', value: "FFFFFfFFF" },
            { label: '4545', value: "FFFFsfFFFF" },
            { label: '4545', value: "FFFFFFFF" },
            { label: '4545', value: "FFFFfFFFF" },
          ]}
        />
      </View>
type DropDownPickerProps = {
    placeholderConfig?: {
        noResultsFoundPlaceholder?: string,
        searchPlaceholder?: string,
        placeholder?: string,
    },

    multipleConfig?: {
        asset?: {
            checked?: number,
            unchecked?: number
        }
        hasMultiple: boolean,
        setStoreValue: React.Dispatch<any[]>,
        storeValue: any[],
        selectedTitle: string,
        resetTitle: string,
    }
    singleConfig?: {
        value: {
            id?: number | string,
            label: string;
            value: string;
        },
        defaultValue: {
            id?: number | string,
            label: string;
            value: string;
        },
        setValue: React.Dispatch<React.SetStateAction<{
            id?: number | string,
            label: string;
            value: string;
        }>>
    }

    hiddenArrow?: boolean,
    imageStyle?: ViewStyle | TextStyle | ImageStyle | object,
    textStyle?: ViewStyle | TextStyle | ImageStyle | object,
    width?: number,
    disable?: boolean,
    disableStyle?: ViewStyle | TextStyle | ImageStyle | object,
    containerStyle?: ViewStyle | TextStyle | ImageStyle | object,
    items: {
        id?: number | string,
        label: string;
        value: string;
    }[],
    animationType?: "slide" | "fade"
    asset?: number,
}
PropertyDescription
placeholderConfigConfiguration for the placeholder text, including noResultsFoundPlaceholder, searchPlaceholder, and placeholder.
multipleConfigConfiguration for multiple selections, including asset, hasMultiple, setStoreValue, storeValue, selectedTitle, and resetTitle.
singleConfigConfiguration for single selection, including value, defaultValue, and setValue.
hiddenArrowA boolean indicating whether the arrow icon is hidden.
imageStyleStyling for the image within the component.
textStyleStyling for the text within the component.
widthThe width of the component.
disableA boolean indicating whether the component is disabled.
disableStyleStyling for the disabled component.
containerStyleStyling for the component container.
itemsAn array of objects representing selectable items with properties id, label, and value.
animationTypeThe type of animation for the dropdown, either 'slide' or 'fade'.
assetAn optional asset for customization, including checked and unchecked properties.
1.0.5-0.1

2 days ago

1.0.49

3 days ago

1.0.50

2 days ago

1.0.48

1 month ago

1.0.47

1 month ago

1.0.46

2 months ago

1.0.44

2 months ago

1.0.45

2 months ago

1.0.43

4 months ago

1.0.42

5 months ago

1.0.41

5 months ago

1.0.40

5 months ago

1.0.39

5 months ago

1.0.38

5 months ago

1.0.37

5 months ago

1.0.36

5 months ago

1.0.35

5 months ago

1.0.34

5 months ago

1.0.33

5 months ago

1.0.32

5 months ago

1.0.31

5 months ago

1.0.30

6 months ago

1.0.29

6 months ago

1.0.28

6 months ago

1.0.27

6 months ago

1.0.26

6 months ago

1.0.25

6 months ago

1.0.24

6 months ago

1.0.2-3.1

6 months ago

1.0.23

6 months ago

1.0.22

6 months ago

1.0.21

6 months ago

1.0.21-beta

6 months ago

1.0.20

6 months ago

1.0.19

6 months ago

1.0.18

6 months ago

1.0.17

6 months ago

1.0.16

6 months ago

1.0.15

6 months ago

1.0.14

6 months ago

1.0.13

6 months ago

1.0.12

6 months ago

1.0.11

6 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago