# grapesjs-component-countdown

> Simple countdown component for the GrapesJS Editor

Latest version **1.0.2** (published 2023-06-06) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install grapesjs-component-countdown
pnpm add grapesjs-component-countdown
yarn add grapesjs-component-countdown
bun add grapesjs-component-countdown
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-06-06 |
| First published | 2017-11-19 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 24.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Artur Arseniev |
| Maintainers | artf |
| Keywords | grapesjs, plugin, component, countdown, wysiwyg |

## Links

- npm: https://www.npmjs.com/package/grapesjs-component-countdown
- Repository: https://github.com/GrapesJS/components-countdown
- Homepage: https://github.com/GrapesJS/components-countdown#readme
- Issues: https://github.com/GrapesJS/components-countdown/issues
- npm.io page: https://npm.io/package/grapesjs-component-countdown

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-06-06
- 1.0.1 — 2022-08-29
- 0.1.3 — 2018-04-25
- 0.1.2 — 2018-04-01
- 0.1.1 — 2017-11-19

## README

# GrapesJS Countdown

Simple countdown component for GrapesJS Editor

<p align="center"><img src="https://artf.github.io/grapesjs/img/countdown.gif" alt="GrapesJS" align="center"/></p>
<br/>

# [Demo](http://grapesjs.com/demo.html)





## Summary

* Plugin name: `grapesjs-component-countdown`
* Components: `countdown`
* Blocks: `countdown`


## Options

| Option | Description | Default |
|-|-|-
| `id` | The ID used to create the block and component. | `countdown` |
| `label` | The label used for the block and the component. | `Countdown` |
| `block` | Object to extend the default block, eg. `{ label: 'Countdown', category: 'Extra', ... }`. Pass a falsy value to avoid adding the block. | `{}` |
| `props` | Object to extend the default component properties., eg. `{ name: 'Countdown', droppable: false, ... }`. | `{}` |
| `style` | Custom CSS styles for the component. This will replace the default one. | `''` |
| `styleAdditional` | Additional CSS styles for the component. These will be appended to the default one. | `''` |
| `startTime` | Default start time, eg. `2030-01-25 00:00`. | `''` |
| `endText` | Text to show when the countdown is ended. | `'EXPIRED'` |
| `dateInputType` | Date input type, eg. `date`, `datetime-local` | `'date'` |
| `labelDays` | Days label text used in component. | `'days'` |
| `labelHours` | Hours label text used in component. | `'hours'` |
| `labelMinutes` | Minutes label text used in component. | `'minutes'` |
| `labelSeconds` | Seconds label text used in component. | `'seconds'` |
| `classPrefix` | Countdown component class prefix. | `'countdown'` |





## Download

* CDN
  * `https://unpkg.com/grapesjs-component-countdown`
* NPM
  * `npm i grapesjs-component-countdown`
* GIT
  * `git clone https://github.com/artf/grapesjs-component-countdown.git`






## Usage

Directly in the browser
```html
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-component-countdown.min.js"></script>

<div id="gjs"></div>

<script type="text/javascript">
  var editor = grapesjs.init({
      container : '#gjs',
      // ...
      plugins: ['grapesjs-component-countdown'],
      pluginsOpts: {
        'grapesjs-component-countdown': { /* options */ }
      }
  });
</script>
```

Modern javascript
```js
import grapesjs from 'grapesjs';
import pluginCountdown from 'grapesjs-component-countdown';

const editor = grapesjs.init({
  container : '#gjs',
  // ...
  plugins: [pluginCountdown],
  pluginsOpts: {
    [pluginCountdown]: { /* options */ }
  }
  // or
  plugins: [
    editor => pluginCountdown(editor, { /* options */ }),
  ],
});
```





## Development

Clone the repository

```sh
$ git clone https://github.com/artf/grapesjs-component-countdown.git
$ cd grapesjs-component-countdown
```

Install it

```sh
$ npm i
```

Start the dev server

```sh
$ npm start
```

Build before the commit. This will also increase the patch level version of the package

```sh
$ npm run build
```





## License

BSD 3-Clause

---
_Source: https://npm.io/package/grapesjs-component-countdown · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
