1.0.1 • Published 6 months ago

@tntx/dashboard-card-react v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

TNT dashboard 卡片组件

安装

npm i @tntx/dashboard-card-react --save

使用

import React from "react";
import DashboardCard from "../src";
import { message, Row, Col } from "antd";
import {
  AreaChartOutlined,
  DotChartOutlined,
  HeartOutlined,
  UserOutlined,
} from "@ant-design/icons";

export default () => {
  const list: any = [
    {
      title: "内容生成量",
      count: "5367",
      color: "#F78435",
      icon: <AreaChartOutlined />,
    },
    {
      title: "内容点击量",
      count: "123",
      color: "#6BCE6B",
      icon: <DotChartOutlined />,
    },
    {
      title: "内容曝光量",
      count: "5643",
      color: "#59a6e5",
      icon: <HeartOutlined />,
    },
    {
      title: "用户活跃数",
      count: "7779",
      color: "#ec7f7f",
      icon: <UserOutlined />,
    },
  ];
  return (
    <Row gutter={20}>
      {list.map((item: any, index: number) => {
        return (
          <Col span={6}>
            <DashboardCard
              key={index}
              {...item}
              onClick={() => {
                message.info("点击了卡片");
              }}
            />
          </Col>
        );
      })}
    </Row>
  );
};

API

组件 API

API

参数说明类型是否必须默认值
title标题string-
tipText提示文本string-
count数量number | string-
countPrefix数量前缀string-
countUnit数量单位string-
countColor数量颜色string-
icon图标React.ReactNode-
color颜色string#59a6e5
iconShape图标形状round | circleround
theme主题default | s1 | s2 | s3 | s4default
bgGradient是否启用背景渐变booleanfalse
1.0.1

6 months ago

1.0.0

6 months ago