React Card

React Card

·

2 min read

React Card is a flexible container component.

Setup

Refer to PrimeReact setup documentation for download and installation steps for your environment.

Import

import { Card } from 'primereact/card';

Getting Started

Card is used as a container.

<Card>
    Content
</Card>

Title

Title text of the card is provided using the title property whereas subTitle property is available for additional information about the card. Both of these properties accept JSX as well.

<Card title="Title" subTitle="SubTitle">
    Content
</Card>

Header and Footer sections are defined using the properties of the same name.

const header = <img alt="Card" src='showcase/demo/images/usercard.png'/>;
const footer = <span>
    <Button label="Save" icon="pi pi-check" style={{marginRight: '.25em'}}/>
    <Button label="Cancel" icon="pi pi-times" className="p-button-secondary"/>
</span>;

<Card footer={footer} header={header}>
    Content
</Card>

Theming

Card supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.

Resources

Visit the PrimeReact Card showcase for demos and documentation.