React Native MantineInputs

TransferList

Dual-list selection transfer

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

Usage

import { useState } from 'react';
import { TransferList } from 'react-native-mantine';
import type { TransferListData } from 'react-native-mantine';

const [data, setData] = useState<[TransferListData, TransferListData]>([
  {
    items: [
      { value: 'react', label: 'React' },
      { value: 'vue', label: 'Vue' },
    ],
    selectedValues: [],
  },
  { items: [{ value: 'svelte', label: 'Svelte' }], selectedValues: [] },
]);

<TransferList
  value={data}
  onChange={setData}
  titles={['Available', 'Selected']}
  searchable
  listHeight={250}
/>

Props

PropTypeDefaultDescription
value (required)[TransferListData, TransferListData]Current data state
onChange (required)(value: [TransferListData, TransferListData]) => voidCalled when data changes
titles[React.ReactNode, React.ReactNode]['', '']Titles for both lists
searchPlaceholderstring'Search...'Placeholder for search inputs
searchablebooleanfalseIf true, lists will have search
colorMantineColor'blue'Transfer list color
sizeMantineSize'md'Transfer list size
radiusMantineNumberSize'sm'Border radius
listHeightnumber300List height
transferAllMatchingFilterbooleanfalseIf true, transfer-all moves only the items matching the current search filter (accepted for Mantine parity, not yet applied)
itemComponentReact.ComponentType<{ data: TransferListDataItem; selected: boolean }>Render custom item
styleanyAdditional styles
testIDstringTest identifier used by testing frameworks

Source on GitHub · npm