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="ri-user-3-line"
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

Card Statistics Horizontal

The CardStatHorizontal component is tailored for presenting statistics in a horizontal layout. It's an ideal choice for showcasing key figures such as customer counts, sales numbers, or any other significant data in a visually appealing and easy-to-read format.

This component is placed inside the src/components/card-statistics/Horizontal.tsx file. You may refer to the src/views/pages/widget-examples/statistics/Horizontal.tsx file for it's usage.

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

// Component Imports
import CardStatHorizontal from '@components/card-statistics/Horizontal'

<CardStatHorizontal
title='Total Revenue'
stats='$48.2K'
avatarIcon='ri-money-dollar-circle-line'
avatarColor='success'
trendNumber='22.5%'
trend='up'
avatarSkin='light'
/>

Props

PropTypeRequiredDescription
titlestringYesThe title displayed on the card
statsstringYesThe statistic number displayed on the card
trend'up'NoDirection of the trend (upward or downward)
trendNumberstringYesNumerical value indicating the trend
avatarIconstringYesIcon to display inside the avatar
avatarColor'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'NoColor theme for the avatar
avatarSizenumberNoThe size of the avatar. Can be a predefined a number.
avatarSkin'filled' | 'light' | 'light-static'NoThe skin or variant for the avatar.

Card Statistics Vertical

The CardStatVertical component is adeptly designed for vertically-oriented presentation of key statistics. This format is particularly suitable for detailed data display, where additional information such as chips and icons enhances the understanding of the metrics.

This component is placed inside the src/components/card-statistics/Vertical.tsx file. You may refer to the src/app/[lang]/(dashboard)/dashboards/crm/page.tsx and src/views/pages/widget-examples/statistics/Vertical.tsx files for it's usage.

To utilize the CardStatVertical component in your application:

// Component Imports
import CardStatVertical from '@components/card-statistics/Vertical'

<CardStatVertical
stats='155k'
title='Total Orders'
trendNumber='22%'
chipText='Last 4 Month'
avatarColor='primary'
avatarIcon='ri-shopping-cart-line'
avatarSkin='light'
chipColor='secondary'
/>

Props

PropTypeRequiredDescription
titlestringYesThe title displayed at the top of the card
statsstringYesThe main statistic number displayed
trend'positive' | 'negative'NoIndicates if the trend is positive or negative
trendNumberstringYesPercentage showing the change in numbers
chipTextstringYesText displayed inside the chip
chipColor'default' | 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'NoColor of the chip
avatarIconstringYesIcon displayed inside the avatar
avatarColor'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'NoColor theme for the avatar
avatarSizenumberNoThe size of the avatar. Can be a predefined a number.
avatarSkin'filled' | 'light' | 'light-static'NoThe skin or variant for the avatar.

Card Statistics Image

The CardStatWithImage component offers a creative way to feature statistics along with a related image, providing a visual context that enhances the data representation.

This component is placed inside the src/components/card-statistics/Character.tsx file. You may refer to the src/app/[lang]/(dashboard)/dashboards/ecommerce/page.tsx and src/views/pages/widget-examples/statistics/Characters.tsx files for it's usage.

Here's how to implement the CardStatWithImage component in your application:

// Component Imports
import CardStatWithImage from '@components/card-statistics/Character'

<CardStatWithImage
stats='8.14k'
title='Ratings'
trendNumber='15.6%'
chipColor='primary'
chipText={`Year of ${new Date().getFullYear()}`}
src='/images/illustrations/characters/10.png'
/>

Props

PropTypeRequiredDescription
srcstringYesImage source URL
titlestringYesTitle displayed above the statistics
statsstringYesMain statistic number displayed
trend'positive' | 'negative'NoIndicates the trend direction
trendNumberstringYesNumerical value indicating the trend
chipTextstringYesText displayed inside the chip
chipColor'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info'NoColor of the chip