React Native MantineData display

DataList

Display a list of label-value pairs

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

Usage

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

<DataList withDivider labelWidth={100} size="sm">
  <DataList.Item>
    <DataList.ItemLabel>Name</DataList.ItemLabel>
    <DataList.ItemValue>John Doe</DataList.ItemValue>
  </DataList.Item>
  <DataList.Item>
    <DataList.ItemLabel>Email</DataList.ItemLabel>
    <DataList.ItemValue>john.doe@example.com</DataList.ItemValue>
  </DataList.Item>
</DataList>

// Vertical orientation
<DataList orientation="vertical" gap="md">
  ...
</DataList>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeDataList.Item components
size'xs' | 'sm' | 'md' | 'lg' | 'xl'"sm"Controls font size of labels and values
gapMantineNumberSize"sm"Key of theme.spacing or number, gap between items
orientation'horizontal' | 'vertical'"horizontal"Orientation of items, horizontal renders label and value side by side
withDividerbooleanfalseDetermines whether items should be separated with a divider
labelWidthnumber120Width of the label column in horizontal orientation
styleViewStyleAdditional styles to apply to the root element

Source on GitHub · npm