Card is a flexible container component.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque quas!
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque quas!
import { Card } from 'primereact/card';
<script src="https://unpkg.com/primereact/core/core.min.js"></script>
<script src="https://unpkg.com/primereact/card/card.min.js"></script>
Card is used as a container.
<Card>
Content
</Card>
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='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>
Name | Type | Default | Description |
---|---|---|---|
id | string | null | Unique identifier of the element. |
header | any | null | Header of the card. |
footer | any | null | Footer of the card. |
title | any | null | Title of the card. |
subTitle | any | null | Secondary title of the card. |
style | object | null | Inline style of the component. |
className | string | null | Style class of the component. |
Following is the list of structural style classes, for theming classes visit theming page.
Name | Element |
---|---|
p-card | Container element. |
p-card-title | Title element. |
p-card-subtitle | Subtitle element. |
p-card-content | Content of the card. |
p-card-footer | Footer of the card. |
This section is under development. After the necessary tests and improvements are made, it will be shared with the users as soon as possible.
None.
Built-in component themes created by the PrimeReact Theme Designer.
Premium themes are only available exclusively for PrimeReact Theme Designer subscribers and therefore not included in PrimeReact core.
Beautifully crafted premium create-react-app application templates by the PrimeTek design team.