Skip to content

githubliufuwen/cron-expression-input

Repository files navigation

Cron Expression Input

MIT License GitHub Release

Description

Cron Expression UI: Input component to generate cron expressions easily and intuitively, as in https://crontab.guru/

Examples

cron-expression-input cron-expression-input-modal

Instructions

NPM

Install the package from https://www.npmjs.com/cron-expression-input

npm install cron-expression-input@1.2.2

In your code

import "cron-expression-input@1.2.2/cron-expression-input.min.css"; /* CSS */
require("cron-expression-input@1.2.2"); /* JAVASCRIPT */

CDN

Add the CDN to your project

<link rel="stylesheet" href="https://unpkg.com/cron-expression-input@1.2.2/lib/cron-expression-input.min.css">
<script src="https://unpkg.com/cron-expression-input@1.2.2/lib/cron-expression-input.min.js"></script>

Usage

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sample Page</title>
    <link rel="stylesheet" href="https://unpkg.com/cron-expression-input@1.2.2/lib/cron-expression-input.min.css">
    <script src="https://unpkg.com/cron-expression-input@1.2.2/lib/cron-expression-input.min.js"></script>
</head>
<body>
    <!-- Component -->
    <cron-expression-input color="d58512"></cron-expression-input>
    <!-- Component -->
    <script src="cron-expression-input.js"></script>
</body>
</html>

Component Attributes

You can pass various attributes to the component to modify its behavior, Example with color attribute:

Name Type Default Description
width {String} 100% The width of the component input
height {String} 34px The height of the component input
color {String} #d58512 The main color that the component elements will take, (Only in hexadecimal)

Thanks

About

Cron UI: Input component to generate cron expressions easily and intuitively

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 64.9%
  • CSS 33.6%
  • HTML 1.5%