0.1.2 • Published 1 year ago

react-native-swal v0.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

react-native-swal

This library is really simple popup modal same as Sweet Alert in React Native.

React-native-swal popup for a second(It can be cutomize) and closed.

ezgif-5-3efbc9f5a3 ezgif-1-48c03b2d4b

Document

Installation

npm i react-native-swal

How to use

Import react-native-swal.

import Swal from 'react-native-swal';

Add the source code below to where you want to use it.

return (
     <Swal
        swal={swal}
        setSwal={setSwal}
        text={text}
        backgroundcolor="#225"
        color="white"
        positionFromBottom={80}
        fontsize={16}
        touchOutSideClose={true}
        duration={3000}
        textStyle={{fontFamily: 'NotoSans'}}
        button={true}
        buttonText={'hello'}
        btnFunction={() => setMode(!mod)}
        btnStyle={{color: 'red'}}
        popup={false}
      />
);

Properties

Below are react-native-swal specific properties.

ProprequiredTypeDescription
swalObooleanmodal's state
setSwalO(open: boolean) => voidmodal's setState
textOstringtext you want to show
backgroundcolorXstringbackground color for swal (default : "black")
colorXstringtext color for swal (default : "white")
positionFromBottomXnumberset the position from bottom (default : 80)
fontsizeXnumbertext font size (default : 16)
touchOutSideCloseXbooleanIf you choose this props as true this modal is closed when you click outside of modal (default : false)
popupXbooleanset swal is pop up and gone or not(default : true)
durationXnumberset how long swal opened (default : 2000(2s)(popup Prop has to be true))
textStyleX{}set text style in modal-> main text
buttonXbooleanadd additional button to do some function when you click it
buttonTextXstringset button's text(it shows when button Prop is true)
btnStyleX{}set button's textStyle underline is default (it shows when button Prop is true)
btnFunctionX() => voidset function when you hit the button(it shows when button Prop is true)
abort-controllerabsolute-pathacceptsacornacorn-jsxajvanseransi-colorsansi-fragmentsansi-regexansi-stylesanymatchappdirsjsargparsearr-diffarr-flattenarr-unionarray-includesarray-unionarray-uniquearray.prototype.flatmapasapassign-symbolsast-typesastral-regexasyncasync-limiteratobavailable-typed-arraysbabel-corebabel-plugin-polyfill-corejs2babel-plugin-polyfill-corejs3babel-plugin-polyfill-regeneratorbabel-plugin-syntax-trailing-function-commasbabel-preset-fbjsbalanced-matchbasebase64-jsblbrace-expansionbracesbrowserslistbserbufferbuffer-frombytescache-basecall-bindcaller-callsitecaller-pathcallsitescamelcasecaniuse-litechalkci-infoclass-utilscli-cursorcli-spinnerscliuicloneclone-deepcollection-visitcolor-convertcolor-namecolorettecommand-existscommandercommondircomponent-emittercompressiblecompressionconcat-mapconnectconvert-source-mapcopy-descriptorcore-js-compatcore-util-iscosmiconfigcross-spawncsstypedayjsdebugdecamelizedecode-uri-componentdeep-isdeepmergedefaultsdefine-propertiesdefine-propertydenodeifydepddeprecated-react-native-prop-typesdestroydir-globdoctrineee-firstelectron-to-chromiumemoji-regexencodeurlend-of-streamenquirerenvinfoerror-exerror-stack-parsererrorhandleres-abstractes-set-tostringtages-shim-unscopableses-to-primitiveescaladeescape-htmlescape-string-regexpeslint-scopeeslint-utilseslint-visitor-keysespreeesprimaesqueryesrecurseestraverseesutilsetagevent-target-shimexecaexpand-bracketsextend-shallowextglobfast-deep-equalfast-difffast-globfast-json-stable-stringifyfast-levenshteinfast-xml-parserfastqfb-watchmanfile-entry-cachefill-rangefinalhandlerfind-cache-dirfind-upflat-cacheflattedflow-parserfor-eachfor-infragment-cachefreshfs-extrafs.realpathfseventsfunction-bindfunction.prototype.namefunctional-red-black-treefunctions-have-namesgensyncget-caller-fileget-intrinsicget-streamget-symbol-descriptionget-valueglobglob-parentglobalsglobalthisglobbygopdgraceful-fshashas-bigintshas-flaghas-property-descriptorshas-protohas-symbolshas-tostringtaghas-valuehas-valueshermes-estreehermes-parserhermes-profile-transformerhttp-errorsieee754ignoreimage-sizeimport-freshimurmurhashinflightinheritsinternal-slotinvariantipis-accessor-descriptoris-array-bufferis-arrayishis-bigintis-boolean-objectis-bufferis-callableis-core-moduleis-data-descriptoris-date-objectis-descriptoris-directoryis-extendableis-extglobis-fullwidth-code-pointis-globis-interactiveis-negative-zerois-numberis-number-objectis-plain-objectis-regexis-shared-array-bufferis-streamis-stringis-symbolis-typed-arrayis-unicode-supportedis-weakrefis-windowsis-wslisarrayisexeisobjectjest-environment-nodejest-get-typejest-message-utiljest-mockjest-regex-utiljest-serializerjest-utiljest-validatejest-workerjoijs-tokensjs-yamljsc-androidjscodeshiftjsescjson-parse-better-errorsjson-schema-traversejson-stable-stringify-without-jsonifyjson5jsonfilejsx-ast-utilskind-ofkleurlevenlevnlocate-pathlodashlodash.debouncelodash.throttlelog-symbolslogkittyloose-envifylru-cachemake-dirmakeerrormap-cachemap-visitmemoize-onemerge-streammerge2metrometro-babel-transformermetro-cachemetro-cache-keymetro-configmetro-coremetro-file-mapmetro-hermes-compilermetro-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-fnminimatchminimistmixin-deepmkdirpmsnanomatchnatural-comparenegotiatorneo-asyncnice-trynocachenode-dirnode-fetchnode-int64node-releasesnode-stream-zipnormalize-pathnpm-run-pathnullthrowsob1object-assignobject-copyobject-inspectobject-keysobject-visitobject.assignobject.entriesobject.fromentriesobject.hasownobject.pickobject.valueson-finishedon-headersonceonetimeopenoptionatororaos-tmpdirp-finallyp-limitp-locatep-tryparent-moduleparse-jsonparseurlpascalcasepath-existspath-is-absolutepath-keypath-parsepath-typepicocolorspicomatchpifypiratespkg-dirposix-character-classesprelude-lsprettier-linter-helperspretty-formatprocess-nextick-argsprogresspromisepromptsprop-typespumppunycodequeue-microtaskrange-parserreactreact-devtools-corereact-isreact-nativereact-native-codegenreact-native-gradle-pluginreact-refreshreact-shallow-rendererreadable-streamreadlinerecastregenerateregenerate-unicode-propertiesregenerator-runtimeregenerator-transformregex-notregexp.prototype.flagsregexppregexpu-coreregjsparserrepeat-elementrepeat-stringrequire-directoryrequire-main-filenameresolveresolve-fromresolve-urlrestore-cursorretreusifyrimrafrun-parallelsafe-buffersafe-regexsafe-regex-testschedulersemversendserialize-errorserve-staticset-blockingset-valuesetprototypeofshallow-cloneshebang-commandshebang-regexshell-quoteside-channelsignal-exitsisteransislashslice-ansisnapdragonsnapdragon-nodesnapdragon-utilsource-mapsource-map-resolvesource-map-supportsource-map-urlsplit-stringsprintf-jsstack-utilsstackframestacktrace-parserstatic-extendstatusesstring-widthstring.prototype.matchallstring.prototype.trimendstring.prototype.trimstartstring_decoderstrip-ansistrip-eofstrip-json-commentsstrnumsudo-promptsupports-colorsupports-preserve-symlinks-flagtabletemptersertext-tablethroatthrough2tmplto-fast-propertiesto-object-pathto-regexto-regex-rangetoidentifiertr46tslibtsutilstype-checktype-detecttype-festtyped-array-lengthuglify-esunbox-primitiveunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunion-valueuniversalifyunpipeunset-valueupdate-browserslist-dburi-jsurixuseuse-sync-external-storeutil-deprecateutils-mergev8-compile-cachevaryvlqwalkerwcwidthwebidl-conversionswhatwg-fetchwhatwg-urlwhichwhich-boxed-primitivewhich-modulewhich-typed-arrayword-wrapwrap-ansiwrappywritewrite-file-atomicwsxtendy18nyallistyargsyargs-parseryocto-queue
0.1.2

1 year ago

0.1.1

1 year ago

0.2.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago