🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

rc-countdown-view

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-countdown-view

A simple countdown react component.

latest
Source
npmnpm
Version
3.0.1
Version published
Weekly downloads
22
340%
Maintainers
1
Weekly downloads
 
Created
Source

rc-countdown-view

npm GitHub

一个简单的 React 倒计时组件。

查看示例

安装

npm install rc-countdown-view
yarn add rc-countdown-view
pnpm add rc-countdown-view

示例

import CountDown from 'rc-countdown-view';

export default () => {
  return <CountDown time={10 * 60 * 60 * 1000} />;
};

API

除了以下属性,还支持 span 标签的其他属性。

参数说明类型默认值
time倒计时,单位毫秒number0
interval时间间隔,单位毫秒number1000
format格式化。
如果传入 string 将自动转换 DD-日,HH-时,mm-分,ss-秒,SSS-毫秒
如果传入 function,必须要有返回值 string 且不会自动转换。
string | (timestamp: number, formatRes: { days: number, hours: number, minutes: number, seconds: number, milliseconds: number }) => voidHH:mm:ss
autoStart自动开始booleantrue
onChange时间变化时触发,参数是 format 的返回值。(formatTime: string) => void-
onEnd倒计时结束时触发() => void-
actionRef常用操作,开始/暂停/重置MutableRefObject<ActionType>-

Keywords

countdown

FAQs

Package last updated on 05 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts