1.1.1 • Published 9 months ago

react-native-language-select v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Installation

Add the dependency:

npm i react-native-language-select

Import

import LanguagePicker, { ILanguagePicker } from "react-native-language-select";

Example Data

const data: ILanguagePicker[] = [
  {
    title: "English",
    imageSource: require("./lib/local-assets/america.png"),
    language: "en",
  },
  {
    title: "Italian",
    imageSource: require("./lib/local-assets/italy.png"),
  },
  {
    title: "German",
    imageSource: require("./lib/local-assets/germany.png"),
  },
  {
    title: "Turkish",
    imageSource: require("./lib/local-assets/turkey.png"),
    language: "tr-TR",
  },
  {
    title: "Swedish",
    imageSource: require("./lib/local-assets/sweden.png"),
  },
  {
    title: "Japanese",
    imageSource: require("./lib/local-assets/japan.png"),
  },
];

Usage

<LanguagePicker
  initialIndex={1}
  data={data}
  onSelect={(selectedItem: ILanguagePicker) => {
    onsole.log(selectedItem);
  }}
/>

Configuration - Props

Fundamentals

PropertyTypeDefaultDescription
dataILanguagePickerundefinedLanguage select data
onSelectfunctionundefinedselect the language item when it is pressed

Customization (Optionals)

PropertyTypeDefaultDescription
flatListStylestyledefaultset or override the style object for the main container
containerWidthwindowWidth * 0.9numberset the main container width
containerHeightwindowHeight * 0.7numberset the main container height
initialIndexnumberundefinedset your selected language item
widthwindowWidth * 0.9numberset the language item width
height80numberset the language item height
backgroundColor'#FFFFFF'stringset the language item background color
activeBorderColor'#504ED9'stringsset the language item active item border color
textColor'#2F3452'stringset to language text
itemContainerdefaultdefaultchange the language item container style
imageComponentdefaultReact.ReactNode / React.ReactNode[]change the language image component
checkComponentdefaultReact.ReactNode / React.ReactNode[]change the check component
languageItemPropsdefaultILanguageItemPropschange the language item props

Future Plans

  • LICENSE

Inspiration

Thank you Oww Studio )

Author

Sevval Eygul, sevvalleygull@gmail.com

License

React Native Language Select is available under the MIT license. See the LICENSE file for more info.