New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-like-button

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-like-button

Animated Like Button Component for React native apps

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

React Native Like Button

Provides an animated like/unlike button for reusability.

Features

  • Animated Like Button
  • Fully customizable

✨ Preview

Installation

Just run the below command in your project folder

Note:- This runs only in React Native CLI project. For Expo projects, use this package.

To install,

npm install --save react-native-like-button

Usage

UnControlled Component

Below shown is the usage of the component as an uncontrolled component.

import LikeButton from 'react-native-like-button';

...

// basic Usage
<LikeButton />

Controlled Component

For controlled component, you can use it as shown.

import LikeButton from "react-native-like-button";

const [Liked, SetLiked] = useState(true);

const onLikePress = async () => {
  // Do something for Like operation
  SetLiked(true);
};

const onUnLikePress = async () => {
  // Do something for Like operation
  SetLiked(true);
};

// basic Usage
<LikeButton liked={Liked} onPress={Liked ? onUnLikePress : onLikePress} />;

Parameters

Basic Parameters

ParameterDefaultDescription
likedundefinedColor of the timestamp which shows total time that has been elapsed since the video started playing
onPressundefinedColor of the timestamp which shows total duration of the clip
iconSizeundefinedColor of the timestamp which shows total duration of the clip

Liked Icon Component Props

ParameterDefaultDescription
likedColorredColor of the liked icon
likedIconName"heart-outline"name of the icon when liked is true (Derived from MaterialCommunityIcons family)
customLikedComponentnullcustom component to show in place of liked icon

UnLiked Icon Component Props

ParameterDefaultDescription
unlikedColorblackColor of the unliked icon
unlikedIconName"heart"name of the icon when liked is false (Derived from MaterialCommunityIcons family)
customUnlikedComponentnullcustom component to show in place of unliked icon

Keywords

like-button

FAQs

Package last updated on 24 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts