Logo

DataTable.Title

A component to display title in table header.

Usage

import * as React from 'react';
import { DataTable } from 'react-native-paper';

const MyComponent = () => (
      <DataTable>
        <DataTable.Header>
          <DataTable.Title
            sortDirection='descending'
          >
            Dessert
          </DataTable.Title>
          <DataTable.Title numeric>Calories</DataTable.Title>
          <DataTable.Title numeric>Fat (g)</DataTable.Title>
        </DataTable.Header>
      </DataTable>
);

export default MyComponent;

Props

children (required)
Type: React.ReactNode

Text content of the DataTableTitle.

numeric
Type: boolean

Align the text to the right. Generally monetary or number fields are aligned to right.

sortDirection
Type: 'ascending' | 'descending'

Direction of sorting. An arrow indicating the direction is displayed when this is given.

numberOfLines
Type: number
Default value: 1

The number of lines to show.

onPress
Type: () => void

Function to execute on press.

style
Type: StyleProp<ViewStyle>
theme
Type: ReactNativePaper.Theme
Edit this page