New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-coming

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-coming

React component rendering a simple page with a countdown timer.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

npm-version npm-download

react-coming

React component rendering a simple page with a countdown timer.

Preview

preview.png

Motivation

Sometimes, when we are working on a website or web application, we want to do deploy and show something to our users as quickly as possible. The react-coming library allows you to quickly render a view with a future date countdown. You can set this component to be enabled and rendered only for the production build, for example.

Installation

To install the hook you can use npm:

npm i react-coming

or Yarn if you prefer:

yarn add react-coming

Usage

All you need is simple import the component:

import { Coming } from 'react-coming';

And render the component:

import { render } from 'react-dom';
import { Coming } from 'react-coming';

render(
  <Coming enabled={process.env.NODE_ENV === 'production'} toDate="YYYY-MM-DD">
    <App />
  </Coming>,
  document.getElementById('app')
);

When the countdown is over (0 seconds left) then the children prop will be rendered.

Children will also be rendered if you give a wrong date format.

Custom render component

If you want, you can pass customComponent prop to the Coming component to render your own component instead of the default countdown page.

Passed component will receive countdown data as props: days, hours, minutes, seconds.

You can use the countdown data to display inside your own component.

Available Props

NameTypeDescriptionDefault value
enabledbooleanProp that indicates whether the Coming component should be rendered.true
toDatestringDate in the format YYYY-MM-DD to which the component will countdown.Current date + 3 months
toTimestringTime in HH:MM format to which the component will countdown.00:00
daysLabelstringLabel text for days.days
hoursLabelstringLabel text for hours.hours
minutesLabelstringLabel text for minutes.minutes
secondsLabelstringLabel text for seconds.seconds
customComponentReactNodeCustom React node to render instead of default Coming countdown page-

Keywords

FAQs

Package last updated on 20 Aug 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc