ExpoStartup

Selectable

A selectable option component with icon and description support

Selectable

A component that displays a selectable option with an icon, title, and optional description.

Import

import Selectable from '@/components/forms/Selectable';

Props

PropTypeDefaultDescription
titlestringRequiredThe title text of the selectable option
descriptionstringOptional description text
iconIconNameRequiredIcon to display with the option
iconColorstringCustom color for the icon
selectedbooleanfalseWhether the option is selected
onPress() => voidFunction called when option is pressed
errorstringError message to display
classNamestringAdditional classes for the option
containerClassNamestringAdditional classes for the container

Basic Usage

<Selectable
  title="Credit Card"
  icon="CreditCard"
  selected={selectedPayment === 'credit'}
  onPress={() => setSelectedPayment('credit')}
/>

With Description

<Selectable
  title="Apple Pay"
  description="Fast checkout with Apple Pay"
  icon="Apple"
  selected={selectedPayment === 'apple'}
  onPress={() => setSelectedPayment('apple')}
/>

Custom Icon Color

<Selectable
  title="PayPal"
  icon="DollarSign"
  iconColor="#0070ba"
  selected={selectedPayment === 'paypal'}
  onPress={() => setSelectedPayment('paypal')}
/>

On this page