React Native MantineInputs

NativeSelect

Platform-native dropdown select

Import: import { NativeSelect } from 'react-native-mantine';

Usage

import { NativeSelect } from 'react-native-mantine';

<NativeSelect
  label="Choose a framework"
  placeholder="Select an option"
  data={[
    { value: 'react', label: 'React' },
    { value: 'vue', label: 'Vue' },
    { value: 'angular', label: 'Angular' }
  ]}
  value={value}
  onChange={setValue}
/>

Props

PropTypeDefaultDescription
data (required)(string | SelectItem)[]Select options data. Can be array of strings or objects with {value, label, disabled} structure
labelReact.ReactNodeInput label displayed above the select
descriptionReact.ReactNodeDescription text displayed below the select
errorReact.ReactNodeError message displayed below the select, also adds error styling
size'xs' | 'sm' | 'md' | 'lg' | 'xl'"sm"Controls select height and font size
radiusnumber | "xs" | "sm" | "md" | "lg" | "xl""sm"Key of theme.radius or any valid number to set border-radius
variant'default' | 'filled' | 'unstyled'"default"Controls select appearance - default (with border), filled (with background), or unstyled
fullWidthbooleanfalseIf true, select will take full width of parent container
valuestringControlled selected value. If provided, select becomes a controlled component
defaultValuestringDefault selected value for uncontrolled mode
onChange(value: string) => voidCallback fired when selected value changes, receives new value as argument
disabledbooleanfalseIf true, select will be disabled and not respond to user interactions
placeholderstringPlaceholder text displayed when no value is selected
iconReact.ReactNodeIcon element displayed on the left side of the select
requiredbooleanfalseIf true, adds an asterisk (*) to the label to indicate required field
styleViewStyleAdditional styles to apply to the select input container
wrapperStyleViewStyleAdditional styles to apply to the outer wrapper (includes label and description)

Source on GitHub · npm