Skip to main content

Card Statistics

Overview

We have created different versions of card components to make it easier for you to show your statistics neatly.

Card Statistics Horizontal with subtitle

The HorizontalWithSubtitle component enriches the presentation of statistics by incorporating a horizontal layout with additional context provided by subtitles. This component is specifically designed for displaying comprehensive metrics, such as user engagement figures, financial statistics, or any key performance indicators, with an emphasis on changes or trends over time.

This component is placed inside the src/components/card-statistics/HorizontalWithSubtitle.tsx file. You may refer to the src/views/apps/user/list/UserListCards.tsx file for it's usage.

Usage

Here's an example of how to use the HorizontalWithSubtitle component:

import HorizontalWithSubtitle from "@components/card-statistics/HorizontalWithSubtitle";

const Component = () => {
return (
<HorizontalWithSubtitle
title="Session"
subtitle="Total User"
stats="21,459"
avatarIcon="tabler-user"
avatarColor="primary"
trend="positive"
trendNumber="29%"
/>
);
};

export default Component;

Props

PropTypeRequiredDescription
titlestringYesThe title displayed on the card
subtitlestringYesThe subtitle displayed on the card
statsstringYesThe primary statistic number displayed
avatarIconstringYesIcon to display inside the avatar
trend'positive' | 'negative'YesThe trend of the statistic
trendNumberstringYesNumerical value indicating the trend
avatarColor'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'NoColor theme for the avatar

Card Statistics Horizontal with border

The HorizontalWithBorder component is designed to enhance the presentation of statistics by incorporating a horizontal layout with a bordered card design. This component is ideal for displaying comprehensive metrics, such as user engagement figures, financial statistics, or any key performance indicators, with an emphasis on changes or trends over time. The border and shadow effects add a visually appealing dynamic when users interact with the component.

This component is placed inside the src/components/card-statistics/HorizontalWithBorder.tsx file. You may refer to the src/views/apps/logistics/dashboard/LogisticsStatisticsCard.tsx file for its usage.

Usage

Here's an example of how to use the HorizontalWithBorder component:

import HorizontalWithBorder from "@components/card-statistics/HorizontalWithBorder";

const Component = () => {
return (
<HorizontalWithBorder
title="Active Users"
stats={15278}
change={12.5}
avatarIcon="ri-user-line"
color="success"
/>
);
};

export default Component;

Props

PropTypeRequiredDescription
titlestringYesThe title displayed on the card
statsnumberYesThe primary statistic number displayed
trendNumbernumberYesThe change in the statistic
avatarIconstringYesIcon to display inside the avatar
color'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'NoColor theme for the avatar

Card Statistics Horizontal with avatar

The HorizontalWithAvatar component is designed to present statistical data in a horizontal layout, enhanced by a customizable avatar. This component is ideal for showcasing key metrics such as user statistics, performance indicators, or financial data, with an emphasis on visually appealing and informative displays.

This component is located in the src/components/card-statistics/HorizontalWithAvatar.tsx file. For usage examples, refer to the src/views/apps/ecommerce/referrals/HorizontalStatisticsCard.tsx file.

Usage

Here's an example of how to use the HorizontalWithAvatar component:

import HorizontalWithAvatar from "@components/card-statistics/HorizontalWithAvatar";

const ExampleComponent = () => {
return (
<HorizontalWithAvatar
stats="$15,362"
title="Total Earning"
avatarIcon="ri-money-dollar-circle-line"
avatarColor="primary"
avatarVariant="rounded"
avatarSkin="light"
avatarSize={42}
/>
);
};

export default ExampleComponent;

Props

PropTypeRequiredDescription
statsstringYesThe statistic value displayed on the card
titlestringYesThe title displayed on the card
avatarIconstringYesIcon to display inside the avatar
avatarColor'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'NoColor theme for the avatar
avatarVariant'circular' | 'rounded' | 'square'NoVariant for the avatar
avatarSkin'light' | 'filled' | 'light-static'NoSkin for the avatar
avatarSizenumberNoSize of the avatar

Card Customer Statistics

The CustomerStats component is designed to display customer-related statistics in a visually appealing card format. This component is ideal for showcasing key customer metrics, such as customer Account Balance, Wishlist, or any other pertinent customer data, with customizable options for icons, colors, and descriptions.

This component is placed inside the src/components/card-statistics/CustomerStats.tsx file. You may refer to the src/views/apps/ecommerce/customers/details/customer-right/overview/CustomerStatisticsCard.tsx file for its usage.

Usage

Here's an example of how to use the CustomerStats component with value and content props:

import CustomerStats from "@components/card-statistics/CustomerStats";

const CustomerDashboard = () => {
return (
<CustomerStats
title="customer satisfaction"
avatarIcon="ri-emotion-happy-line"
color="warning"
stats="94%"
content="Satisfaction Rate"
description="based on recent feedback"
/>
);
};

export default CustomerDashboard;

Here's an example of how to use the CustomerStats component with chipLabel prop:

import CustomerStats from "@components/card-statistics/CustomerStats";

const CustomerDashboard = () => {
return (
<CustomerStats
title="loyalty program"
avatarIcon="ri-gift-line"
color="success"
chipLabel="Platinum member"
description="3000 points to next tier"
/>
);
};

export default CustomerDashboard;

Props

PropTypeRequiredDescription
titlestringYesThe title displayed on the card
avatarIconstringYesIcon to display inside the avatar
descriptionstringYesDescription displayed on the card
statsstringNoThe primary statistic number displayed
contentstringNoAdditional content displayed on the card
chipLabelstringNoLabel displayed on the chip
color'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'NoColor theme for the avatar