Card

Displays a card with header, content, and footer.

Installation

Terminal
npx flexnative-cli add "https://registry.flexnative.com/c/card.json"

Usage


Importing
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
Using
<Card>
<CardHeader>
  <CardTitle>Card Title</CardTitle>
  <CardDescription>Card Description</CardDescription>
</CardHeader>
<CardContent>
  <p>Card Content</p>
</CardContent>
<CardFooter>
  <p>Card Footer</p>
</CardFooter>
</Card>

Examples

API

Card

Displays a container to wrap header, content, and footer with dynamic styling based on the theme.


PropTypeDescriptionDefault
childrenReactNodeContent of the card.-
styleStyleProp<ViewStyle>Additional styles for the card.-

CardHeader

Defines the top section of the card, typically for the title and description.

PropTypeDescriptionDefault
childrenReactNodeContent inside the header.-
styleStyleProp<ViewStyle>Additional styles for the header.-

CardTitle

Renders the main title within the CardHeader.

PropTypeDescriptionDefault
childrenReactNodeTitle text.-
styleStyleProp<TextStyle>Additional styles for the title.-

CardDescription

Provides a smaller descriptive text within the CardHeader.

PropTypeDescriptionDefault
childrenReactNodeDescription text.-
styleStyleProp<TextStyle>Additional styles for the description.-

CardContent

Main content area of the card for body elements.

PropTypeDescriptionDefault
childrenReactNodeBody content.-
styleStyleProp<ViewStyle>Additional styles for the content.-

CardFooter

Defines the bottom section of the card, often for actions like buttons.

PropTypeDescriptionDefault
childrenReactNodeFooter content.-
styleStyleProp<ViewStyle>Additional styles for the footer.-