Multi-Select Screen with Checkboxes

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

import React, { useState } from 'react';
import {
  StyleSheet,
  SafeAreaView,
  View,
  TouchableOpacity,
  Text,
  ScrollView,
} from 'react-native';
import FeatherIcon from 'react-native-vector-icons/Feather''@expo/vector-icons/Feather';

const skillCategories = [
  {
    id: 'languages',
    name: 'Languages',
    icon: 'language',
    skills: [
      { emoji: '🇪🇸', name: 'Spanish' },
      { emoji: '🇫🇷', name: 'French' },
      { emoji: '🇯🇵', name: 'Japanese' },
      { emoji: '🇨🇳', name: 'Mandarin' },
      { emoji: '🇩🇪', name: 'German' },
      { emoji: '🇮🇹', name: 'Italian' },
      { emoji: '🇰🇷', name: 'Korean' },
      { emoji: '🇵🇹', name: 'Portuguese' },
    ],
  },
  {
    id: 'art',
    name: 'Art & Design',
    icon: 'brush',
    skills: [
      { emoji: '✏️', name: 'Drawing' },
      { emoji: '🎨', name: 'Painting' },
      { emoji: '💻', name: 'Digital Art' },
      { emoji: '📸', name: 'Photography' },
      { emoji: '🎬', name: 'Animation' },
      { emoji: '🖌️', name: 'Illustration' },
      { emoji: '🗿', name: 'Sculpture' },
      { emoji: '📝', name: 'Typography' },
      { emoji: '🌈', name: 'Color Theory' },
      { emoji: '🏠', name: 'Interior Design' },
      { emoji: '👗', name: 'Fashion Design' },
    ],
  },
];

export default function Example() {
  const [form, setForm] = useState({
    selectedSkills: [],
    searchQuery: '',
  });

  return (
    <SafeAreaView style={{ flex: 1, backgroundColor: '#F4EFF3' }}>
      <View style={styles.header}>
        <TouchableOpacity
          onPress={() => {
            // handle onPress
          }}
          style={styles.headerAction}>
          <FeatherIcon
            color="#F82E08"
            name="arrow-left"
            size={24} />
        </TouchableOpacity>

        <Text style={styles.title}>What Do You Teach?</Text>

        <Text style={styles.subtitle}>
          Discover and master new skills with expert-led video courses
        </Text>
      </View>

      <ScrollView>
        {skillCategories.map((category, categoryIndex) => (
          <View key={category.id} style={styles.section}>
            <Text style={styles.sectionTitle}>{category.name}</Text>

            <View style={styles.skillsGrid}>
              {category.skills.map((skill, skillIndex) => {
                const isSelected = form.selectedSkills.includes(skill.name);

                return (
                  <TouchableOpacity
                    key={`${categoryIndex}-${skillIndex}`}
                    onPress={() => {
                      const newSkills = isSelected
                        ? form.selectedSkills.filter(s => s !== skill.name)
                        : [...form.selectedSkills, skill.name];
                      setForm({ ...form, selectedSkills: newSkills });
                    }}
                    style={[
                      styles.skillCard,
                      isSelected
                        ? { borderColor: '#F82E08', backgroundColor: '#FFF5F5' }
                        : {},
                    ]}>
                    <View>
                      <Text style={styles.skillEmoji}>{skill.emoji}</Text>

                      <Text style={styles.skillName}>{skill.name}</Text>
                    </View>

                    {isSelected && (
                      <FeatherIcon
                        color="#F82E08"
                        name="check-circle"
                        size={20} />
                    )}
                  </TouchableOpacity>
                );
              })}
            </View>
          </View>
        ))}
      </ScrollView>

      <View style={styles.formFooter}>
        <TouchableOpacity
          onPress={() => {
            // handle onPress
          }}>
          <View style={styles.btn}>
            <Text style={styles.btnText}>Continue</Text>
          </View>
        </TouchableOpacity>
      </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  title: {
    fontSize: 34,
    fontWeight: 'bold',
    color: '#181818',
    marginBottom: 12,
  },
  subtitle: {
    fontSize: 15,
    lineHeight: 20,
    fontWeight: '500',
    color: '#889797',
  },
  skillsGrid: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    margin: -6,
  },
  formFooter: {
    marginTop: 'auto',
    marginBottom: 24,
    paddingTop: 12,
    paddingHorizontal: 24,
    paddingBottom: 0,
    fontSize: 15,
    lineHeight: 20,
    fontWeight: '400',
    color: '#9fa5af',
    textAlign: 'center',
  },
  /** Header */
  header: {
    paddingHorizontal: 24,
    marginBottom: 28,
  },
  headerAction: {
    width: 40,
    height: 40,
    borderRadius: 9999,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#ffdada',
    marginBottom: 16,
  },
  /** Section */
  section: {
    marginBottom: 16,
    paddingVertical: 0,
    paddingHorizontal: 24,
  },
  sectionTitle: {
    fontSize: 13,
    fontWeight: '600',
    color: '#889797',
    marginBottom: 12,
    textTransform: 'uppercase',
  },
  skillCard: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'flex-start',
    width: '30%',
    margin: 4,
    padding: 8,
    backgroundColor: '#fff',
    borderRadius: 8,
    borderWidth: 1.5,
    borderColor: '#e5e7eb',
  },
  skillEmoji: {
    fontSize: 16,
    lineHeight: 20,
    marginBottom: 2,
  },
  skillName: {
    fontSize: 13,
    lineHeight: 18,
    fontWeight: '500',
    color: '#1d2a32',
    marginTop: 4,
  },
  /** Button */
  btn: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: 8,
    paddingVertical: 16,
    paddingHorizontal: 24,
    borderWidth: 1,
    backgroundColor: '#F82E08',
    borderColor: '#F82E08',
  },
  btnText: {
    fontSize: 17,
    lineHeight: 22,
    fontWeight: 'bold',
    color: '#fff',
  },
});

Dependencies

Before getting started, make sure you have all the necessary dependencies for this component. Follow the steps below to install any missing dependencies.

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!