Back to React Native Paper

Card.Title

docs/public/4.0/card-title.html

5.15.11.9 KB
Original Source

Card.Title

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

Usage

js
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

title (required) Type: React.ReactNode

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

titleStyle Type: StyleProp<TextStyle>

Style for the title.

titleNumberOfLines Type: number

Default value: 1

Number of lines for the title.

subtitle Type: React.ReactNode

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

subtitleStyle Type: StyleProp<TextStyle>

Style for the subtitle.

subtitleNumberOfLines Type: number

Default value: 1

Number of lines for the subtitle.

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

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

leftStyle Type: StyleProp<ViewStyle>

Style for the left element wrapper.

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

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

rightStyle Type: StyleProp<ViewStyle>

Style for the right element wrapper.

style Type: StyleProp<ViewStyle>

theme Type: ReactNativePaper.Theme

Edit this page