1.3.1 • Published 9 months ago

easy-select-rn v1.3.1

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

React Native Easy Select

Platforms License

React Native Easy Select is a customizable and easy-to-use picker component for React Native. It allows you to create a selector with a bottom sheet modal, providing a smooth user experience for selecting options.

Installation

Install the package using npm or yarn:

npm install easy-select-rn

or

yarn add easy-select-rn

Usage

Import the `Picker` component from `easy-select-rn` and use it in your React Native application:

import React, { useState } from 'react';

import { View, Text } from 'react-native';

import { Picker } from 'easy-select-rn';

const MyComponent = () => {
  const [selectedValue, setSelectedValue] = useState('');

  const data = [
    { value: 'option1', label: 'Option 1' },
    { value: 'option2', label: 'Option 2' },
    { value: 'option3', label: 'Option 3' },
  ];

  return (
    <View>
      <Text>Select an option:</Text>
      <Picker
        data={data}
        label="Select an option"
        value={selectedValue}
        onValueChange={(value) => setSelectedValue(value)}
      />
      <Text>Selected Value: {selectedValue}</Text>
    </View>
  );
};

Props

The `Picker` component accepts the following props:

PropTypeDefaultDescription
dataArray of { value: string, label: string }[]An array of options to display in the picker.
labelstringLabel for the picker input.
includeSelectbooleanfalseWhether to include a "Select" option at the beginning of the list.
selectLabelstring"Select an option"Label for the "Select" option.
valuestring""Currently selected value.
defaultValuestring""Default value for the picker.
onValueChangefunctionCallback function to handle value changes.
boxPosition"center", "flex-start", "flex-end""center"Position of the selector box.
sizeLgstring"70%"Size of the selector box for large screens.
sizeLxstring"63%"Size of the selector box for extra-large screens.

MultiSelectPicker

A React component that displays a multiple selection list with a filterable text field.

Usage

import { MultiSelectPicker } from 'package-name';

const data = [
  { key: '1', labelData: 'Option 1' },
  { key: '2', labelData: 'Option 2' },
  // ... more data
];

const App = () => {
  const [selectedValues, setSelectedValues] = useState([]);

  const handleValuesChange = (values) => {
    setSelectedValues(values);
  };

  return (
    <MultiSelectPicker
      loading={false}
      error={null}
      placeholder="Type to filter..."
      label="Select options"
      data={data}
      values={selectedValues}
      keyData="key"
      labelData="labelData"
      onValuesChange={handleValuesChange}
    />
  );
};

Props

PropTypeDescription
loadingbooleanIndicates whether the component is loading data.
errorstring (optional)The error message in case an error occurs during loading.
placeholderstringThe text of the filterable text field to guide the user.
labelstringThe label of the multiple selection field.
dataArrayAn array of objects containing the data for the list.
valuesArrayAn array of strings representing the selected values.
keyDatastringThe name of the property in the objects of `data` that contains the unique identifier.
labelDatastringThe name of the property in the objects of `data` that contains the label to display.
boxPosition"center", "flex-start", "flex-end""center"Position of the selector box.
sizeLgstring"70%"Size of the selector box for large screens.
sizeLxstring"63%"Size of the selector box for extra-large screens.

License

MIT License. See the LICENSE file for more information.

abort-controlleracceptsacornacorn-jsxacorn-walkadd-streamagent-baseaggregate-errorajvanseransi-alignansi-escapesansi-fragmentsansi-regexansi-stylesanymatchappdirsjsargargparsearray-buffer-byte-lengtharray-ifyarray-includesarray-unionarray.prototype.flatarray.prototype.flatmaparray.prototype.maparray.prototype.tosortedarraybuffer.prototype.slicearrifyasapast-typesastral-regexasyncasync-limiterasync-retryat-least-nodeavailable-typed-arraysbabel-corebabel-jestbabel-plugin-istanbulbabel-plugin-jest-hoistbabel-plugin-polyfill-corejs2babel-plugin-polyfill-corejs3babel-plugin-polyfill-regeneratorbabel-plugin-syntax-trailing-function-commasbabel-plugin-transform-flow-enumsbabel-preset-current-node-syntaxbabel-preset-fbjsbabel-preset-jestbalanced-matchbase64-jsbasic-ftpbefore-after-hookbig-integerbinary-extensionsblboxenbplist-parserbrace-expansionbracesbrowserslistbserbufferbuffer-frombundle-namebytescacheable-lookupcacheable-requestcall-bindcaller-callsitecaller-pathcallsitescamelcasecamelcase-keyscamelizecaniuse-litechalkchar-regexchardetchokidarci-infocjs-module-lexerclean-stackcli-boxescli-cursorcli-spinnerscli-widthcliuicloneclone-deepcocollect-v8-coveragecolorcolor-convertcolor-namecolor-stringcolorettecommand-existscommandercommondircompare-funccompressiblecompressionconcat-mapconcat-streamconfig-chainconfigstoreconnectconventional-changelogconventional-changelog-angularconventional-changelog-atomconventional-changelog-codemirrorconventional-changelog-conventionalcommitsconventional-changelog-coreconventional-changelog-emberconventional-changelog-eslintconventional-changelog-expressconventional-changelog-jqueryconventional-changelog-jshintconventional-changelog-preset-loaderconventional-changelog-writerconventional-commits-filterconventional-commits-parserconventional-recommended-bumpconvert-source-mapcore-js-compatcore-util-iscosmiconfigcreate-requirecross-spawncrypto-random-stringcss-color-keywordscss-to-react-nativecsstypedargsdata-uri-to-bufferdateformatdayjsdebugdecamelizedecamelize-keysdecompress-responsededentdeep-extenddeep-isdeepmergedefault-browserdefault-browser-iddefaultsdefer-to-connectdefine-lazy-propdefine-propertiesdegeneratordeldenodeifydepddeprecated-react-native-prop-typesdeprecationdestroydetect-newlinediffdiff-sequencesdir-globdoctrinedot-propeastasianwidthee-firstelectron-to-chromiumemitteryemoji-regexencodeurlend-of-streamenvinfoerror-exerror-stack-parsererrorhandleres-abstractes-array-method-boxes-properlyes-get-iteratores-set-tostringtages-shim-unscopableses-to-primitiveescaladeescape-goatescape-htmlescape-string-regexpescodegeneslint-plugin-eslint-commentseslint-plugin-ft-floweslint-plugin-jesteslint-plugin-reacteslint-plugin-react-hookseslint-plugin-react-nativeeslint-plugin-react-native-globalseslint-scopeeslint-visitor-keysespreeesprimaesqueryesrecurseestraverseesutilsetagevent-target-shimexecaexitexpectexternal-editorfast-deep-equalfast-difffast-globfast-json-stable-stringifyfast-levenshteinfast-xml-parserfastqfb-watchmanfetch-blobfiguresfile-entry-cachefill-rangefinalhandlerfind-cache-dirfind-upfind-yarn-workspace-rootflat-cacheflattedflow-enums-runtimeflow-parserfor-eachform-data-encoderformdata-polyfillfreshfs-extrafs-readdir-recursivefs.realpathfunction-bindfunction.prototype.namefunctions-have-namesgensyncget-caller-fileget-intrinsicget-package-typeget-pkg-repoget-streamget-symbol-descriptionget-urigit-raw-commitsgit-remote-origin-urlgit-semver-tagsgit-upgit-url-parsegitconfiglocalglobglob-parentglobal-dirsglobalsglobalthisglobbygopdgotgraceful-fsgraphemerhandlebarshard-rejectionhashas-bigintshas-flaghas-property-descriptorshas-protohas-symbolshas-tostringtaghas-yarnhermes-estreehermes-parserhermes-profile-transformerhoist-non-react-staticshosted-git-infohtml-escaperhttp-cache-semanticshttp-errorshttp-proxy-agenthttp2-wrapperhttps-proxy-agenthuman-signalsiconv-liteieee754ignoreimage-sizeimport-freshimport-lazyimport-localimurmurhashindent-stringinflightinheritsiniinquirerinternal-slotinterpretinvariantipis-absoluteis-argumentsis-array-bufferis-arrayishis-bigintis-binary-pathis-boolean-objectis-callableis-ciis-core-moduleis-date-objectis-directoryis-dockeris-extglobis-fullwidth-code-pointis-generator-fnis-git-dirtyis-git-repositoryis-globis-inside-containeris-installed-globallyis-interactiveis-mapis-negative-zerois-npmis-numberis-number-objectis-objis-path-cwdis-path-insideis-plain-objis-plain-objectis-regexis-relativeis-setis-shared-array-bufferis-sshis-streamis-stringis-symbolis-text-pathis-typed-arrayis-typedarrayis-unc-pathis-unicode-supportedis-weakrefis-windowsis-wslis-yarn-globalisarrayisexeisobjectissue-parseristanbul-lib-coverageistanbul-lib-instrumentistanbul-lib-reportistanbul-lib-source-mapsistanbul-reportsiterate-iteratoriterate-valuejest-changed-filesjest-circusjest-clijest-configjest-diffjest-docblockjest-eachjest-environment-nodejest-get-typejest-haste-mapjest-leak-detectorjest-matcher-utilsjest-message-utiljest-mockjest-pnp-resolverjest-regex-utiljest-resolvejest-resolve-dependenciesjest-runnerjest-runtimejest-snapshotjest-utiljest-validatejest-watcherjest-workerjetifierjoijs-tokensjs-yamljsc-androidjsc-safe-urljscodeshiftjsescjson-bufferjson-parse-better-errorsjson-parse-even-better-errorsjson-schema-traversejson-stable-stringify-without-jsonifyjson-stringify-safejson5jsonfilejsonparseJSONStreamjsx-ast-utilskeyvkind-ofklaw-synckleurlatest-versionlevenlevnlines-and-columnsload-json-filelocate-pathlodash.camelcaselodash.capitalizelodash.debouncelodash.escaperegexplodash.isfunctionlodash.ismatchlodash.isplainobjectlodash.isstringlodash.kebabcaselodash.mergelodash.mergewithlodash.snakecaselodash.startcaselodash.throttlelodash.uniqlodash.uniqbylodash.upperfirstlog-symbolslogkittyloose-envifylowercase-keyslru-cachemacos-releasemake-dirmake-errormakeerrormap-objmemoize-onemeowmerge-streammerge2metrometro-babel-transformermetro-cachemetro-cache-keymetro-configmetro-coremetro-file-mapmetro-inspector-proxymetro-minify-tersermetro-minify-uglifymetro-react-native-babel-presetmetro-react-native-babel-transformermetro-resolvermetro-runtimemetro-source-mapmetro-symbolicatemetro-transform-pluginsmetro-transform-workermicromatchmimemime-dbmime-typesmimic-fnmimic-responsemin-indentminimatchminimistminimist-optionsmkdirpmodify-valuesmsmute-streamnanoidnatural-comparenatural-compare-litenegotiatorneo-asyncnetmasknew-github-release-urlnocachenode-abort-controllernode-dirnode-domexceptionnode-fetchnode-int64node-releasesnode-stream-zipnormalize-package-datanormalize-pathnormalize-urlnpm-run-pathnullthrowsob1object-assignobject-inspectobject-keysobject.assignobject.entriesobject.fromentriesobject.hasownobject.valueson-finishedon-headersonceonetimeopenoptionatororaos-nameos-tmpdirp-cancelablep-limitp-locatep-mapp-trypac-proxy-agentpac-resolverpackage-jsonparent-moduleparse-jsonparse-pathparse-urlparseurlpatch-packagepath-existspath-is-absolutepath-keypath-parsepath-typepicocolorspicomatchpifypiratespkg-dirpostcsspostcss-value-parserprelude-lsprettier-linter-helperspretty-formatprocess-nextick-argspromisepromise.allsettledpromptsprop-typesproto-listprotocolsproxy-agentproxy-from-envpumppunycodepupaqqueuequeue-microtaskquick-lrurange-parserrcreact-devtools-corereact-isreact-refreshreact-shallow-rendererread-pkgread-pkg-upreadable-streamreaddirpreadlinerecastrechoirredentregenerateregenerate-unicode-propertiesregenerator-runtimeregenerator-transformregexp.prototype.flagsregexpu-coreregistry-auth-tokenregistry-urlregjsparserrequire-directoryrequire-from-stringrequire-main-filenameresolveresolve-alpnresolve-cwdresolve-fromresolve-globalresolve.exportsresponselikerestore-cursorretryreusifyrimrafrun-applescriptrun-asyncrun-parallelrxjssafe-array-concatsafe-buffersafe-regex-testsafer-bufferschedulersemversemver-diffsendserialize-errorserve-staticset-blockingsetprototypeofshallow-cloneshallowequalshebang-commandshebang-regexshell-quoteshelljsside-channelsignal-exitsimple-swizzlesisteransislashslice-ansismart-buffersockssocks-proxy-agentsource-mapsource-map-jssource-map-supportspdx-correctspdx-exceptionsspdx-expression-parsespdx-license-idssplitsplit2sprintf-jsstack-utilsstackframestacktrace-parserstatusesstdin-discarderstop-iteration-iteratorstring-lengthstring-natural-comparestring-widthstring.prototype.matchallstring.prototype.trimstring.prototype.trimendstring.prototype.trimstartstring_decoderstrip-ansistrip-bomstrip-final-newlinestrip-indentstrip-json-commentsstrnumstylissudo-promptsupports-colorsupports-hyperlinkssupports-preserve-symlinks-flagtempterminal-linktersertest-excludetext-extensionstext-tablethroatthroughthrough2titleizetmptmplto-fast-propertiesto-regex-rangetoidentifiertr46trim-newlinests-nodetslibtsutilstype-checktype-detecttype-festtyped-array-buffertyped-array-byte-lengthtyped-array-byte-offsettyped-array-lengthtypedarraytypedarray-to-bufferuglify-esuglify-jsunbox-primitiveunc-path-regexunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunique-stringuniversal-user-agentuniversalifyunpipeuntildifyupdate-browserslist-dbupdate-notifieruri-jsurl-joinuse-latest-callbackuse-sync-external-storeutil-deprecateutils-mergev8-compile-cache-libv8-to-istanbulvalidate-npm-package-licensevaryvlqvm2walkerwcwidthweb-streams-polyfillwebidl-conversionswhatwg-fetchwhatwg-urlwhichwhich-boxed-primitivewhich-modulewhich-typed-arraywidest-linewildcard-matchwindows-releaseword-wrapwordwrapwrap-ansiwrappywrite-file-atomicwsxdg-basedirxtendy18nyallistyamlyargsyargs-parserynyocto-queue
1.3.1

9 months ago

1.3.0

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.1.0

9 months ago