npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@logicamente.info/react-native-toast

v1.0.2

Published

Toast Component meant to be used in expo/RN apps using not native directives

Downloads

1

Readme

React-Native-Toast

NPM version License MIT

Another toast for RN, but now without relying on native module as ToastAndroid to make the job done.

Content

Installation

  1. Run yarn add @logicamente.info/react-native-toast or npm i -S @logicamente.info/react-native-toast
  2. import ToastContainer from '@logicamente.info/react-native-toast' then put this component anywhere in the highest order component of your app (commonly at App.js)
  3. import { Toast } from '@logicamente.info/react-native-toast' then call Toast('This is my message') wherever you need

Demo

Check it out running at https://snack.expo.io/@logicamente.info/react-native-toast.

You can also clone this repo and run yarn start to make it run locally.

Getting started

import React from 'react';
import { View, Button, StyleSheet } from 'react-native';
import ToastContainer, { Toast } from '@logicamente.info/react-native-toast';

export default function App() {
  return (
    <View>
      <ToastContainer />
      <Button
        title="Show Toast"
        onPress={() => Toast('This is my message')} />
    </View>
  );
}

Usage

This lib exports some useful resource to customize it to your needs.

Resource | Description --- | --- ToastContainer | The main react component, should be placed at the highest order component in the app. Toast | Main function to show the toast. Toast(text, position, duration) Where - text can be "string" or a <Component \> - position needs to be one of ToastPosition options (default: ToastPosition.BOTTOM) - duration is the number in miliseconds the toast shall be visible (default: ToastDuration.SHORT) ToastPosition | It is a set of React Native StyleSheets that determines the position where the toast will appear. Available options are - ToastPosition.TOP - ToastPosition.BOTTOM (default) - ToastPosition.LEFT - ToastPosition.RIGHT - ToastPosition.CENTER ToastDuration | A set of timers to configure your toast. Avaliable options are - ToastDuration.SHORT (default) - ToastDuration.LONG - ToastDuration.INFINITE You can inform your own duration in miliseconds when calling Toast, but if you set it to zero, negative or ToastDuration.INFINITE then the toast will not close unless you do it programmatically. ToastHide | A function to close the toast. Meaningful if the toast duration is infinite.

You can also change the ToastContainer base style to suit your needs

  <ToastContainer style={{ backgroundColor: 'blue' }} />

Contribution

Issues and PRs are welcome. Add a screenshot of bug and code snippet. Open a issue to discuss changes.