A plain-English schedule picker for any website. Use it yourself to get cron lines, or give it to your visitors so they pick how often something happens and your site runs it. The CronLex model works in the browser, so there's no server and no API key.
Served from this site. jsDelivr works too: https://cdn.jsdelivr.net/gh/abozaralizadeh/cronai@master/widget/dist/cronai-widget.js.
| Attribute / API | Values | What it does |
|---|---|---|
mode | developer · user | user is for your visitors: no cron, tiles or crontab lines, friendlier text, 3 upcoming runs. |
size | mini · compact · full | Layout. |
show, hide | badge title input status chips tiles cron copy guard description confidence notes runs timezone trigger examples zone, or all | Add or remove parts on top of the mode/size defaults. show="only runs description" starts from nothing. |
strings | JSON | Re-word or translate any text. Also the el.strings property. |
theme | auto · aurora · paper · terminal · sunset · glacier · forest · candy | auto follows the visitor's light or dark setting. |
timezone | IANA name or auto | Zone the times are meant in. Saved with the schedule, so your server runs "9am" at the visitor's 9am. |
value / schedule | text / saved JSON | Starting text, or restore a saved choice (text, zone and every-N-weeks) in edit forms. Both are also properties. |
name, form-value | cron · json · text · description | Works in a <form>; also sends <name>-text (always, what was typed) and <name>-json (when understood). |
required, must-understand | flags | required: filled in and understood. must-understand: may stay empty, but typed text must be understood. |
show="zone" | section | Built-in time-zone picker; defaults to the visitor's zone and goes into the schedule JSON. |
armed, arm(), disarm() | flag | Fires crontrigger on schedule while the page is open, in any size, even with the trigger part hidden. |
cronchange event | detail.schedule, cron, crons, description, nextRuns, timezone, ok | Fires on every new interpretation, and once on load. |
CronAI.createTrigger(schedule, fn) | browser / Node | Run your code at the times a visitor picked. Node: cronai-engine.esm.js. |
CronAI.parse(text, {timezone}), scheduleNextRuns(schedule, n) | JS | Engine without UI. |
CSS variables, ::part() | --cai-accent, --cai-surface, --cai-text, --cai-font, --cai-rad-xl, … · parts named like the sections | cron-ai { --cai-accent: #e11d48 }, cron-ai::part(description) { font-size: 20px }. |