1.0.5 • Published 2 years ago

rn-simple-balloon v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

rn-simple-balloon

preview

Install

from yarn

yarn add rn-simple-balloon

from npm

npm i rn-simple-balloon

Usage

import RNBalloon, { Balloon } from 'rn-simple-balloon'

export const archivesTabBalloon = createRef<Balloon>() //export it if you want to open/close it in other component

...

<RNBalloon //put this inside an element you want to show the balloon
    position={'top'}
    ref={archivesTabBalloon}
    autoHide
    duration={3000}
    styles={{
      padding: 8,
      borderRadius: 4
    }}>
      <Image source={Images.heart} style={{ width: 20, height: 20 }} />
      <Text style={{ textAlign: 'center' }}>Tuan Chan with love :3</Text>
</RNBalloon>

...
import { balloonRef } from '../RootContainer'

 <TouchableOpacity
    ...
    onPress={() => {
    archivesTabBalloon?.current?.open()
    }}
    ...
  />

Properties

PropDefaultTypeDescription
stylesnoneobjectSpecify the style of balloon container
position"top"stringPosition of the balloon ("top", "bottom", "left", "right")
onOpennonefunctionCallback function called when the balloon opened
onDismissnonefunctionCallback function called when the balloon closed
duration1000numberThe balloon's open time

License

MIT License.

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago