Logo

Card.Title

A component to show a title, subtitle and an avatar inside a Card.

Usage

import * as React from 'react';
import { Avatar, Card, IconButton } from 'react-native-paper';

const MyComponent = () => (
  <Card.Title
    title="Card Title"
    subtitle="Card Subtitle"
    left={(props) => <Avatar.Icon {...props} icon="folder" />}
    right={(props) => <IconButton {...props} icon="more-vert" onPress={() => {}} />}
  />
);

export default MyComponent;

Props

Type: React.ReactNode

Text for the title. Note that this will only accept a string or <Text>-based node.

Style for the title.

Type: number
Default value: 1

Number of lines for the title.

titleVariant
Available in v5.x with theme version 3
Default value: 'bodyLarge'

Title text variant defines appropriate text styles for type role and its size. Available variants:

Display: displayLarge, displayMedium, displaySmall

Headline: headlineLarge, headlineMedium, headlineSmall

Title: titleLarge, titleMedium, titleSmall

Label: labelLarge, labelMedium, labelSmall

Body: bodyLarge, bodyMedium, bodySmall

Type: React.ReactNode

Text for the subtitle. Note that this will only accept a string or <Text>-based node.

Style for the subtitle.

Type: number
Default value: 1

Number of lines for the subtitle.

subtitleVariant
Available in v5.x with theme version 3
Default value: 'bodyMedium'

Subtitle text variant defines appropriate text styles for type role and its size. Available variants:

Display: displayLarge, displayMedium, displaySmall

Headline: headlineLarge, headlineMedium, headlineSmall

Title: titleLarge, titleMedium, titleSmall

Label: labelLarge, labelMedium, labelSmall

Body: bodyLarge, bodyMedium, bodySmall

Type: (props: { size: number }) => React.ReactNode

Callback which returns a React element to display on the left side.

Style for the left element wrapper.

Type: (props: { size: number }) => React.ReactNode

Callback which returns a React element to display on the right side.

Style for the right element wrapper.

Edit this page