ant-design/components/statistic/demo/animated.tsx
afc163 755682c317
docs: add animated number demo for Statistic (#40027)
* docs: add animated number demo for Statistic

* style: update demo

* add back countdownValueType

* type: fix demo type
2023-01-05 14:07:33 +08:00

19 lines
510 B
TypeScript

import React from 'react';
import { Col, Row, Statistic } from 'antd';
import CountUp from 'react-countup';
const formatter = (value: number) => <CountUp end={value} separator="," />;
const App: React.FC = () => (
<Row gutter={16}>
<Col span={12}>
<Statistic title="Active Users" value={112893} formatter={formatter} />
</Col>
<Col span={12}>
<Statistic title="Account Balance (CNY)" value={112893} precision={2} formatter={formatter} />
</Col>
</Row>
);
export default App;