Ant Design Library has this component pre-built, and it is very easy to integrate as well. Card Component is used as a simple rectangular container, and it is used when the user wants to display content related to a single subject. We can use the following approach in ReactJS to use the Ant Design Card Component.
Card Props:
actions: It is used to denote the action list.
activeTabKey: It is used to denote the current TabPane's key.
bodyStyle: It is used to denote the inline style to apply to the card content.
bordered: It is used to toggle the rendering of the border around the card.
cover: It is used to denote the Card cover.
defaultActiveTabKey: It is used to denote the Initial active TabPane's key.
extra: It is used for the Content to render in the top-right corner of the card.
headStyle: It is used to denote the Inline style to apply to the card head.
hoverable: It is used to Lift up when hovering the card grid.
loading: It is used to show a loading indicator while the contents of the card are being fetched.
size: It is used to denote the size of the card.
tabBarExtraContent: It is used to denote the Extra content in the tab bar.
tabList: It is used to denote the List of TabPane's head.
tabProps: It is used to denote the Tab props.
title: It is used to denote the Card title.
type: It is used to denote the Card style type.
onTabChange: It is a callback function that is triggered when the tab is switched.
Card.Grid Props:
className: It is used to denote the className of the container.
hoverable: It is used to Lift up when hovering the card grid.
style: It is used to pass the style object of the container.
Card.Meta Props:
avatar: It is used to denote the Avatar or icon.
className: It is used to denote the className of the container.
description: It is used to denote the description content.
style: It is used to pass the style object of the container.
title: It is used to denote the title content.
Creating React Application And Installing Module:
Step 1: Create a React application using the following command:
npx create-react-app foldername
Step 2: After creating your project folder i.e. foldername, move to it using the following command:
cd foldername
Step 3: After creating the ReactJS application, Install therequiredmodule using the following command:
npm install antd
Project Structure: It will look like the following.