Skip to main content

Card

Card

Card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.

Usage

Imports:

import { Card } from 'galio-framework';

Simple example:

<Card
flex
borderless
style={styles.card}
title="Christopher Moon"
caption="139 minutes ago"
location="Los Angeles, CA"
avatar="http://i.pravatar.cc/100?id=skater"
imageStyle={styles.cardImageRadius}
imageBlockStyle={{ padding: theme.SIZES.BASE / 2 }}
image="https://images.unsplash.com/photo-1497802176320-541c8e8de98d?&w=1600&h=900&fit=crop&crop=entropy&q=300"
/>

Advanced examples:

<Card
flex
card
shadow
borderless
style={styles.card}
title="Custom Card"
caption="With custom styling"
titleStyle={{ color: 'primary' }}
captionStyle={{ color: 'muted' }}
footer={
<Block row space="between">
<Text size={12} color="muted">Footer content</Text>
<Button size="small" color="primary">Action</Button>
</Block>
}
/>

Props

PropTypeDefaultDescription
childrennodenullCard content
cardbooltrueAdds card styling
shadowbooltrueAdds shadow styling
borderlessboolfalseRemoves card border
imagestringnullImage URL or path
imageStyleobjectnullCustom image styles
imageBlockStyleobjectnullStyles for the image container
titlestringnullCard title
titleStyleobjectnullCustom title styles
captionstringnullCard caption
captionStyleobjectnullCustom caption styles
locationstringnullLocation text
avatarstringnullAvatar image URL
footernodenullFooter content
styleobjectnullCustom styles
...View.props--All React Native View props are supported