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

react-native-new-feature

v1.0.3

Published

Simple and lightweight component that shows your app new features

Downloads

3

Readme

Table of Contents

  1. Installation
  2. Basic usage
  3. List animations
  4. Customization
    1. TitleView
    2. ListItem
    3. Detail Button
    4. Completion Button
    5. Margin and padding
    6. Animations
  5. Orientation change support
  6. Demo
  7. Contributing

Installation

With npm: $ npm install react-native-new-feature --save

With yarn: $ yarn add react-native-new-feature

Basic usage

import NewFeature from 'react-native-new-feature'

const App = (props) => {
  const data = {
    title: {
      text: 'What\'s New',
    },
    items: [
      {
        title: {
          text: 'Easy setup',
        },
        subtitle: {
          text: 'The simple and typesafe WhatsNew struct enables you to structurize your awesome new app features',
        },
        image: {
          component: <Image source={require('./assets/icons8-approval-100.png')} style={{ width: 45, height: 45, tintColor: 'red' }}/>,
        }
      },
    ],
    detailButton: {
      text: 'Read more',
    },
    completionButton: {
      text: 'Continue',
    }
  }

  return (
    <NewFeature
      visible={true}
      title={data.title}
      items={data.items}
      detailButton={{
        ...data.detailButton,
      }}
      completionButton={{
        ...data.completionButton,
      }}
    />
  )
}

Customization

React Native New Feature can be fully customized as your need. Below is detail of sub components included and list of animations available:

TitleView

Properties:
- text: string (required)
- color: string
- size: number
- weight: '600' // same as fontWeight property. default is '600'

Usage:

<NewFeature
  title={{
    text: 'Title',
    color: 'black',
    size: 35
  }}
  {...other props}
/>

ListItem

This component uses ScrollView to render list of new features, each row is a ItemView component which made from 3 sub-components ItemImage, ItemTitle and ItemSubtitle as described in picture below:

To customize these components,read the sections below.

Item Image

Properties:
- component(required): React component, usually is a <Image> or <Icon> ...,

Item Title and Item Subtitle

Properties:
- text: string (required)
- color: string // default is 'black' if don't specify
- size: number // default is 17 if don't specify
- weight: 'bold' // same as fontWeight property

Detail Button

Properties:
- text: string (required)
- color: string
- size: number
- weight: 'bold' // same as fontWeight property
- handler: function

Usage:

const myHandler = () => {
  console.log(1)
}

<NewFeature
  detailButton={{
    text: 'Read more',
    color: 'red',
    size: 17,
    handler: myHandler
  }}
  {...other props}
/>

Completion Button

Properties:
- text: string (required),
- color: string,
- size: number
- background: string,
- radius: number,
- weight: 'bold' // same as fontWeight property
- handler: function

Usage:

const myHandler = () => {
  console.log(1)
}

<NewFeature
  completionButton={{
    text: 'Read more',
    color: 'red',
    background: 'blue',
    radius: 14
    size: 17,
    handler: myHandler
  }}
  {...other props}
/>

Margin and Padding

margin and padding props are provided in order to help you have more control on layout. These props are applied to these components:

  • TitleView
  • ItemImage
  • ItemTitle
  • ItemSubtitle
  • DetailButton
  • CompletionButton

Usage:

<NewFeature
  title={{
    margin: {
      top: 1,
      right: 2,
      bottom: 3,
      left: 4
    },
    padding: {
      top: 5,
      right: 6,
      bottom: 7,
      left: 8
    }
  }}
  {...other props}
/>

Animations

This package have 2 types of animations:

  • Animation on root component appear
  • Animation of the ListItem

Root component animation

Root component makes use of Modal component which is built-in of React Native Usage:

<NewFeature
  appearAnimation={'fade'}
/>

appearAnimation is one of:

  • none (default if not specified)
  • fade
  • slide

ListItem animation

Usage:

<NewFeature
  animation={'slide-down'}
/>

animation is one of:

  • none (default if not specified)
  • fade
  • slide-up
  • slide-down
  • slide-right
  • slide-left

Orientation change support

By using purely React Native View flex layout, this component is auto-compatible when device orientation changed

Demo

A complete working demo is located at example folder

Contributing

To start developing with this project, simply run the following commands:

npm install # or yarn install (to install dependencies)

npm run watch # or yarn watch (to build this project in watch mode for development)

npm run build # or yarn build (to build project in production mode)