Secondary Contained Button

Screen is created using these React Native Core Components: <View />, <SafeAreaView />, <TouchableOpacity />, <Text />

import React from 'react';
import {
  StyleSheet,
  View,
  SafeAreaView,
  TouchableOpacity,
  Text,
} from 'react-native';

export default function Example() {
  return (
    <SafeAreaView style={{ flex: 1, backgroundColor: '#fff' }}>
      <View style={styles.container}>
        <View style={styles.buttons}>
          <TouchableOpacity
            onPress={() => {
              // handle onPress
            }}>
            <View style={styles.btnXS}>
              <Text style={styles.btnXSText}>Custom Button</Text>
            </View>
          </TouchableOpacity>
          <TouchableOpacity
            onPress={() => {
              // handle onPress
            }}>
            <View style={styles.btnSM}>
              <Text style={styles.btnSMText}>Custom Button</Text>
            </View>
          </TouchableOpacity>
          <TouchableOpacity
            onPress={() => {
              // handle onPress
            }}>
            <View style={styles.btnMD}>
              <Text style={styles.btnMDText}>Custom Button</Text>
            </View>
          </TouchableOpacity>
          <TouchableOpacity
            onPress={() => {
              // handle onPress
            }}>
            <View style={styles.btnLG}>
              <Text style={styles.btnLGText}>Custom Button</Text>
            </View>
          </TouchableOpacity>
          <TouchableOpacity
            onPress={() => {
              // handle onPress
            }}>
            <View style={styles.btnXL}>
              <Text style={styles.btnXLText}>Custom Button</Text>
            </View>
          </TouchableOpacity>
        </View>
      </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    padding: 24,
    flexGrow: 1,
    flexShrink: 1,
    flexBasis: 0,
  },
  buttons: {
    height: 300,
    alignItems: 'center',
    justifyContent: 'space-between',
  },
  btnXS: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: 8,
    paddingVertical: 6,
    paddingHorizontal: 14,
    borderWidth: 1,
    backgroundColor: '#efefef',
    borderColor: '#efefef',
  },
  btnXSText: {
    fontSize: 13,
    lineHeight: 18,
    fontWeight: '600',
    color: '#0d57b2',
  },
  btnSM: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: 8,
    paddingVertical: 8,
    paddingHorizontal: 16,
    borderWidth: 1,
    backgroundColor: '#efefef',
    borderColor: '#efefef',
  },
  btnSMText: {
    fontSize: 14,
    lineHeight: 20,
    fontWeight: '600',
    color: '#0d57b2',
  },
  btnMD: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: 8,
    paddingVertical: 8,
    paddingHorizontal: 16,
    borderWidth: 1,
    backgroundColor: '#efefef',
    borderColor: '#efefef',
  },
  btnMDText: {
    fontSize: 17,
    lineHeight: 24,
    fontWeight: '600',
    color: '#0d57b2',
  },
  btnLG: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: 8,
    paddingVertical: 10,
    paddingHorizontal: 20,
    borderWidth: 1,
    backgroundColor: '#efefef',
    borderColor: '#efefef',
  },
  btnLGText: {
    fontSize: 18,
    lineHeight: 26,
    fontWeight: '600',
    color: '#0d57b2',
  },
  btnXL: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: 8,
    paddingVertical: 16,
    paddingHorizontal: 24,
    borderWidth: 1,
    backgroundColor: '#efefef',
    borderColor: '#efefef',
  },
  btnXLText: {
    fontSize: 20,
    lineHeight: 28,
    fontWeight: '600',
    color: '#0d57b2',
  },
});

Explore more components

Over 100 Ready to Use React Native Components for all your needs.

Never miss a beat

Stay in the loop with our latest updates and offers - no spam, just the good stuff!