Widgets
Widgets are small and interactive components that display useful information or perform specific actions on your dashboard. You can customize the appearance and behavior of each widget by changing the color, counter, symbol, title, description, border, width, height, padding, and link. You can also create your own widgets by following the same structure and style of the existing widgets.
You can find the widgets component in the src/views/widgets.jsx
file.
Examples
Stats Card
Stats Card widget in a dashboard enables concise presentation of key statistics for efficient data visualization and monitoring in a single view. Widgets Preview
- Preview
- Code
Result
$
Revenue
%
Revenue
%
Lorem ipsum...
Lorem ipsum dolor sit amet enim.
import React from "react";
import StatsCard from "@/components/StatsCard/StatsCard";
import { BarChart, Bar } from "recharts";
const data = [
{
name: "Page A",
uv: 2000,
pv: 2400,
amt: 2400,
},
{
name: "Page B",
uv: 6000,
pv: 1398,
amt: 2210,
},
{
name: "Page C",
uv: 4000,
pv: 9800,
amt: 2290,
},
{
name: "Page D",
uv: 8000,
pv: 3908,
amt: 2000,
},
{
name: "Page E",
uv: 4000,
pv: 4800,
amt: 2181,
},
{
name: "Page F",
uv: 6000,
pv: 3800,
amt: 2500,
},
{
name: "Page G",
uv: 2000,
pv: 4300,
amt: 2100,
},
{
name: "Page G",
uv: 5000,
pv: 4300,
amt: 2100,
},
];
const MyComponent = () => {
return (
<>
<StatsCard
type="revenue-counter"
bgColor="#5c6bc0"
symbol="$"
counter={23569}
isCounter={true}
title="Revenue"
icon="fa-solid fa-cart-shopping"
/>
<StatsCard
type="revenue-counter"
bgColor="#66bb6a"
symbolPosition="right"
symbol="%"
counter={23569}
isCounter={true}
title="Revenue"
icon={
<BarChart width={100} height={80} data={statsCardWithChart}>
<Bar dataKey="uv" fill="#fff" />
</BarChart>
}
/>
<StatsCard
type="revenue-progressBar"
bgColor="#5c6bc0"
symbol="%"
symbolPosition="right"
counter={89}
isCounter={true}
title="Lorem ipsum..."
progressPercent={25}
description="Lorem ipsum dolor sit amet enim."
/>
</>
);
};
export default MyComponent;
Props
Name | Type | Default | Description |
type |
| revenue-counter | A string that specifies the type of the widget. You can choose from
four options: |
bgColor | string | #fff | A string that specifies the background color of the widget. You can
use any valid CSS color value as the value of |
icon | string | A string that specifies the | |
isCounter | boolean | false | A boolean that indicates whether the widget has a counter or not. If
|
counter | number | A number that specifies the value of the | |
symbolPosition | string | left | A string that specifies the position of the symbol relative to the
counter. You can choose from two options: |
symbol | string | A string that specifies the | |
title | string | A string that specifies the | |
description | string | A string that specifies the | |
progressPercent | number | A number that specifies the percentage of the progress bar. You can
use any positive number between | |
isIconBorder | boolean | false | A boolean that indicates whether the icon has a border or not. If
|
borderColor | string | A string that specifies the color of the border of the icon. You can
use any valid CSS color value as the value of | |
padding | string | 16px | A string that specifies the |
width | string | 45px | A string that specifies the |
hight | string | 45px | A string that specifies the |
isViewMore | boolean | false | A boolean that indicates whether the widget has a view more link or
not. If |
link | string | A string that specifies the URL of the view more l |
Social Counter The Social Counter component facilitates the display of social
media metrics such as followers, friends, and more. Widgets Preview
- Preview
- Code
Result
import React from "react";
import SocialCounter from "@/components/SocialCounter/SocialCounter";
const MyComponent = () => {
return (
<SocialCounter
bgColor="#3B5998"
padding="40px"
icon="fa-brands fa-facebook-f"
count="1875980"
iconPosition="top"
socialActivity={{
followers: 40,
countType: "K",
followersType: "Friends",
usre: 40,
feeds: "feeds",
}}
/>
);
};
export default MyComponent;
Props
Name | Type | Default | Description |
bgColor | string | transparent | A string that specifies the background color of the widget. You can
use any valid CSS color value as the value of |
icon | string | A string that specifies the | |
iconPosition | string | left | A string that specifies the position of the icon relative to the
count. You can choose from two options: |
count | number | 0 | A number that specifies the value of the |
padding | string | 24px | A string that specifies the |
isCounter | boolean | false | A boolean that indicates whether the widget has a counter or not. If
|
socialActivity | object | {} | An object that specifies the social activity of the social media
platform or the website. You can use any valid object as the value
of |
User Stats User Stats component showcases user activity progress and details,
offering a concise overview of engagement and interactions. Widgets Preview
- Preview
- Code
Result
87500
Visitorsimport React from "react";
import UserStats from "@/components/UserStats/UserStats";
const MyComponent = () => {
return (
<UserStats
icon="fa-solid fa-users"
conunt={87500}
title="Visitors"
progressBg="#5c6bc0"
progressPercent={80}
/>
);
};
export default MyComponent;
Props
Name | Type | Default | Description |
bgColor | string | A string that specifies the background color of the widget. You can
use any valid CSS color value as the value of | |
icon | string | A string that specifies the | |
conunt | number | 0 | A number that specifies the value of the |
title | string | A string that specifies the | |
size | string | 17px | A string that specifies the |
progressBg | string | #fff | A string that specifies the background color of the progress bar.
You can use any valid CSS color value as the value of |
progressPercent | number | A number that specifies the percentage of the progress bar. You can
use any positive number between |