Skip to content

CronInput

When something runs, as a cron expression with its meaning in words under it: «Every day at 03:00». Presets fill the common ones.

import { CronInput } from '@sypnia/ui/react'

On this page
  1. A backup schedule
  2. When to use it
  3. For everyone
  4. Props

A backup schedule

Every day at 03:00 · America/Bogota

Code
import { useState } from 'react';
import { CronInput, Field } from '@sypnia/ui/react';

// Choose a common schedule or write your own: the words under it follow.
export default function Schedule() {
  const [cron, setCron] = useState('0 3 * * *');
  return <Field label="Run the backup"><CronInput value={cron} onChange={setCron} timezone="America/Bogota" /></Field>;
}

When to use it

Use it when

  • Backups, reports, scheduled functions.

Do not use it when

  • One-off times: use DateTimePicker.

For everyone

  • The words under the field are read when they change; a mistake says what a schedule needs.

Props

CronInputTypeDefault
onChangerequired (v: string) => void
valuerequired string
aria-describedby string
aria-label

The name for screen readers when there is no Field around it.

string
aria-labelledby string
className string
disabled boolean
id

Inside a Field it comes from the Field.

string
timezone string
  1. A backup schedule
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms