@herberthtk/react-native-animated-hearts

0.1.4 • Public • Published

react-native-animated-hearts

Smooth animated heart reactions

Installation

npm install react-native-animated-hearts

Usage

import { useRef } from 'react';
import { View, StyleSheet, Button } from 'react-native';
import HeartAnimation, {
  type HeartAnimationRef,
} from 'react-native-animated-hearts';

export default function App() {
  const heartAnimationRef = useRef<HeartAnimationRef>(null);

  // Trigger the heart animation
  const handleButtonPress = () => {
    heartAnimationRef.current?.triggerAnimation();
  };

  return (
    <View style={styles.container}>
      <HeartAnimation ref={heartAnimationRef} />
      {/* Button to trigger animation */}
      <Button title="Trigger Heart Animation" onPress={handleButtonPress} />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    // justifyContent: 'center',
    // alignItems: 'center',
    backgroundColor: '#fff',
  },
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Package Sidebar

Install

npm i @herberthtk/react-native-animated-hearts

Weekly Downloads

0

Version

0.1.4

License

MIT

Unpacked Size

818 kB

Total Files

41

Last publish

Collaborators

  • htk