Heart Rate

January 17, 2023 ยท View on GitHub

The HeartRate component animates pulse over a grid.

  • HeartRate component has two different variants: Default and FollowUP.

๐ŸŽฌ Preview


HeartRate
alt tag

Default Usage


import React from 'react';
import { StyleSheet, View } from 'react-native';
import { HeartRate, HeartRateEnum } from 'react-native-skia-catalog';

const HeartRateScreen = () => (
  <View style={styles.container}>
    <HeartRate />
  </View>
);

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'space-evenly',
    alignItems: 'center',
  },
});

export default HeartRateScreen;

Custom Usage


import React from 'react';
import { StyleSheet, View } from 'react-native';
import { HeartRate, HeartRateEnum } from 'react-native-skia-catalog';

const HeartRateScreen = () => (
  <View style={styles.container}>
    <HeartRate
      heartRateType={HeartRateEnum.FOLLOWUP}
      color={['#472183', '#86C8BC']}
      isGridVisible={false}
      pulseWidth={12}
      speed={2500}
      size={260}
    />
  </View>
);

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

export default HeartRateScreen;

๐ŸŽฌ Custom Usage Preview


alt tag

Properties

PropsDefaultTypeDescription
heartRateType"Default""Default" / "FollowUp"Type of HeartRate. Note: HeartRateEnum can be used to specify the type. Ex. HeartRateEnum.FOLLOWUP
size200numberHeight of HeartRate. Note: width will be calculated as per height.
color#ff6961string / string[]Color of pulse. If a color passes through an array, a gradient color effect will appear.
gridColor#E6E6FA99stringColor of grid.
speedDefault: 2000 & FollowUp: 4000numberSpeed of pulse.
isGridVisibletruebooleanIt decides whether to enable or disable the grid behind the pulse.
pulseWidth6numberWidth of pulse.

๐ŸŽฌ Preview Example


Heart Rate