React Native Box Shadow

A quick React Native box shadow example:

import { StyleSheet, View } from 'react-native';

const BoxShadowExample = () => {
  return (
    <View style={styles.container}>
      <View style={styles.boxShadow} />
    </View>
  );
};

const styles = StyleSheet.create({
  boxShadow: {
    // android:
    elevation: 1,
    // ios:
    shadowColor: '#000',
    shadowOffset: { height: 1, width: 0 },
    shadowOpacity: 0.1,
    shadowRadius: 1,
  },
  container: {
    backgroundColor: '#fff',
    flex: 1,
  },
});

Published