Skip to content
Product block

Digest Schedule Form

The control that turns notification volume down instead of off, which is the choice most people actually want.

175 linesNo dependenciesAdded 9 Sept 2026
  • notifications
  • digest
  • schedule
  • preferences
  • email

What's included

  • components/digest-schedule-form.tsx
  • No runtime dependencies

Works with

  • React
  • Next.js
  • Tailwind CSS
  • TypeScript

npx hoverlab add digest-schedule-form

Or over MCP, from your editor's agent — no account needed.

License

Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.

Was this useful?

Start a page with this section — add more, order them, and leave with the page source.

Preview

Send it all at once instead

The alternative offered by most products is on or off, so everyone picks off. A time and a floor turns the same stream into one predictable message.

Your local time. Nothing arrives outside this except an outage.

Fewer events than this and no message is sent at all. An empty digest is still an interruption.

Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.

Source

components/digest-schedule-form.tsx
'use client'

/**
 * <DigestScheduleForm> — The control that turns notification volume down instead of off, which is the choice most people actually want.
 *
 * The layout problem is that notification settings are almost always
 * presented as a switch, and a switch has only two positions — the loud one
 * and the one everybody eventually picks. The obvious wrong answer is a
 * longer list of switches, which is the same failure at higher resolution.
 *
 * Volume is a schedule, not a toggle. A send time and a floor turn an
 * unbounded stream into exactly one predictable message, which is a setting
 * someone can live with instead of muting.
 *
 * The second field is the one that is usually missing. Without a floor, a
 * quiet day still produces a digest containing one item, and an empty
 * digest is an interruption that has taught the reader nothing — after a
 * week of those the digest is filtered too.
 *
 * Accessibility: `htmlFor`/`id` label association with the hints on
 * `aria-describedby`, and the `role="status"` region mounted empty from the
 * first paint so the saved confirmation is actually announced. Note that the
 * time input is a real `type="time"` control — it renders the browser's own
 * picker, which looks different everywhere, and that is correct. Restyling
 * it is how a time field stops being operable by keyboard.
 *
 * The demo defaults to `idle`. The fields have no initial values, which is
 * the honest starting state for a preference that has never been set.
 */

import * as React from 'react'

export interface DigestScheduleFormProps {
  heading?: string
  intro?: string
  submitLabel?: string
  /** Called with the collected values. Resolve to accept, throw to reject. */
  onSubmit?: (values: Record<string, string>) => Promise<void> | void
  className?: string
}

type Status = 'idle' | 'pending' | 'done' | 'error'

/*
  A typed array rather than `as const`. With `as const` the entries have
  different shapes - some carry a hint, some do not - so `field.hint` is a
  type error on the members that lack it, and the `'hint' in field` dance
  needed to work around that is worse than declaring the field optional once.
*/
interface DigestScheduleFormField {
  name: string
  label: string
  type: string
  hint?: string
}

const FIELDS: DigestScheduleFormField[] = [
  { name: "time", label: "Send at", type: "time", hint: "Your local time. Nothing arrives outside this except an outage." },
  { name: "threshold", label: "Skip the digest below", type: "number", hint: "Fewer events than this and no message is sent at all. An empty digest is still an interruption." },
]

export function DigestScheduleForm({
  heading = "Send it all at once instead",
  intro = "The alternative offered by most products is on or off, so everyone picks off. A time and a floor turns the same stream into one predictable message.",
  submitLabel = "Save schedule",
  onSubmit,
  className,
}: DigestScheduleFormProps) {
  /*
    Per-instance prefix for every id this block emits.

    The literals these replaced were a latent duplicate the moment the
    block appeared twice on one document, and `aria-labelledby` on a
    duplicated id resolves to the first match -- so the second copy was
    labelled by the first copy's heading. Client component, so `useId` is
    the right tool.
  */
  const uid = React.useId()

  const [status, setStatus] = React.useState<Status>('idle')
  const [message, setMessage] = React.useState('')

  async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
    event.preventDefault()
    const data = new FormData(event.currentTarget)
    const values = Object.fromEntries(
      FIELDS.map((field) => [field.name, String(data.get(field.name) ?? '')]),
    )

    setStatus('pending')
    try {
      await onSubmit?.(values)
      setStatus('done')
      setMessage('Thanks — that came through.')
    } catch (error) {
      setStatus('error')
      setMessage(error instanceof Error ? error.message : 'That did not go through.')
    }
  }

  return (
    <section
      aria-labelledby={`${uid}-digest-schedule-form-heading`}
      className={`w-full bg-background px-6 py-16 ${className ?? ''}`}
    >
      <div className="mx-auto max-w-md rounded-xl border border-border bg-card p-8 shadow-sm">
        <h2
          id={`${uid}-digest-schedule-form-heading`}
          className="text-xl font-semibold tracking-tight text-card-foreground"
        >
          {heading}
        </h2>
        <p className="mt-2 text-sm text-muted-foreground">{intro}</p>

        <form onSubmit={handleSubmit} className="mt-6 space-y-4">
          {FIELDS.map((field) => (
            <div key={field.name}>
              {/*
                htmlFor / id rather than a wrapping label, so the hint can
                sit outside the label and still be announced — that is what
                aria-describedby is for.
              */}
              <label
                htmlFor={`${uid}-digest-schedule-form-${field.name}`}
                className="block text-sm font-medium text-foreground"
              >
                {field.label}
              </label>
              <input
                id={`${uid}-digest-schedule-form-${field.name}`}
                name={field.name}
                type={field.type}
                required
                aria-describedby={field.hint ? `${uid}-digest-schedule-form-${field.name}-hint` : undefined}
                className="mt-1.5 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
              />
              {field.hint ? (
                <p
                  id={`${uid}-digest-schedule-form-${field.name}-hint`}
                  className="mt-1 text-xs text-muted-foreground"
                >
                  {field.hint}
                </p>
              ) : null}
            </div>
          ))}

          <button
            type="submit"
            disabled={status === 'pending'}
            className="w-full rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60"
          >
            {status === 'pending' ? 'Working…' : submitLabel}
          </button>

          {/*
            The live region is always in the DOM and starts empty. A region
            mounted at the moment it gets text is frequently not announced —
            the assistive tech never saw it become live.
          */}
          <p
            role="status"
            aria-live="polite"
            className={`min-h-5 text-sm ${
              status === 'error' ? 'text-destructive' : 'text-muted-foreground'
            }`}
          >
            {message}
          </p>
        </form>
      </div>
    </section>
  )
}

Before you paste

  • Styling is Tailwind utility classes on semantic tokens (bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.
  • Nothing to install. No component library, no icon package.
  • Every prop has a default, so it renders standalone before you wire it up.

Where it goes

Drop it at components/digest-schedule-form.tsx and import it where you need the section:

import { DigestScheduleForm } from '@/components/digest-schedule-form'

Customize

2 of this block’s props are simple enough to drive from here. Change them and the block below re-renders — it is the same component whose source is above, not a mock of it. Everything else it accepts is in the table underneath.

Props

Read out of the component’s own type and signature, so this cannot drift from the source below. Every prop has a default — the component renders standalone before you pass it anything.

PropTypeDefault
headingstring"Send it all at once instead"
introstring—
submitLabelstring"Save schedule"
onSubmitCalled with the collected values. Resolve to accept, throw to reject.(values: Record<string, string>) => Promise<void> | void—
classNamestring—

Not using React?

The same block rendered once to markup, wrapped as a file your framework compiles. Tailwind classes are framework-agnostic, so the design transfers intact — the behaviour does not.

This block is interactive. The markup below is its initial state with the event handlers stripped — you will need to re-wire the behaviour in your framework.

digest-schedule-form.html
<!--
  Digest Schedule Form — markup from the Hoverlab catalog.

  This is the block rendered once to HTML and wrapped as a component
  file. It is not a port of the React source: the Tailwind classes carry
  the design, which is the part that took the work, and they are the same
  in every framework.

  This block is interactive in React and the handlers are NOT here.
  Buttons, toggles and menus render in their initial state and do
  nothing until you wire them up.
-->
<section aria-labelledby="_R_0_-digest-schedule-form-heading" class="w-full bg-background px-6 py-16 ">
  <div class="mx-auto max-w-md rounded-xl border border-border bg-card p-8 shadow-sm">
    <h2 id="_R_0_-digest-schedule-form-heading" class="text-xl font-semibold tracking-tight text-card-foreground">Send it all at once instead</h2>
    <p class="mt-2 text-sm text-muted-foreground">The alternative offered by most products is on or off, so everyone picks off. A time and a floor turns the same stream into one predictable message.</p>
    <form class="mt-6 space-y-4">
      <div>
        <label for="_R_0_-digest-schedule-form-time" class="block text-sm font-medium text-foreground">Send at</label>
        <input id="_R_0_-digest-schedule-form-time" type="time" required="" aria-describedby="_R_0_-digest-schedule-form-time-hint" class="mt-1.5 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" name="time" />
        <p id="_R_0_-digest-schedule-form-time-hint" class="mt-1 text-xs text-muted-foreground">Your local time. Nothing arrives outside this except an outage.</p>
      </div>
      <div>
        <label for="_R_0_-digest-schedule-form-threshold" class="block text-sm font-medium text-foreground">Skip the digest below</label>
        <input id="_R_0_-digest-schedule-form-threshold" type="number" required="" aria-describedby="_R_0_-digest-schedule-form-threshold-hint" class="mt-1.5 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" name="threshold" />
        <p id="_R_0_-digest-schedule-form-threshold-hint" class="mt-1 text-xs text-muted-foreground">Fewer events than this and no message is sent at all. An empty digest is still an interruption.</p>
      </div>
      <button type="submit" class="w-full rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60">Save schedule</button>
      <p role="status" aria-live="polite" class="min-h-5 text-sm text-muted-foreground"></p>
    </form>
  </div>
</section>
  • This is rendered HTML, not a translation of the React source. The Tailwind classes carry the design and work in any framework.
  • It is one frame: the component in its initial state, with no props applied beyond the defaults.
  • This block is interactive in React — toggles, menus or form state. None of that survives here; the markup is the closed/default state and the handlers are gone. Re-wire them in your own framework.
  • Requires Tailwind, and the design tokens the classes reference (bg-card, text-muted-foreground, and so on). The template ZIPs ship a globals.css that defines them.

What each framework gets across the whole catalog — effects convert properly; this rung is markup.

For AI

The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.

See the prompt

Used in these pages

Want the whole screen instead of this one section? Open a page and copy it entire.

6 more blocks in Notifications

All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.

Browse Notifications

Shipping one commercially

Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.

  • A commercial licence for everything in the catalog
  • Unlimited bundle exports, in Vue, Svelte and Tailwind
  • One payment — no subscription, nothing to renew
Pro — $79 once

More Notifications blocks

View category
Open the full page for this block

Toast Notification Stack

A corner stack whose live region is mounted before any message exists, errors announce assertively, and the auto-dismiss timer pauses on hover and on focus.

Notifications171 lines1 dep
Open the full page for this block

Notification Inbox Panel

The bell panel: filterable list with read state, the unread count in the accessible name rather than only in a badge, and machine-readable timestamps beside the human ones.

Notifications255 lines1 dep
Open the full page for this block

Notification Preferences Matrix

Per-event, per-channel switches as a real table, with required notifications locked and explained, and column headers that toggle a whole channel and report a mixed state honestly.

Notifications284 lines1 dep
Open the full page for this block

Push Permission Pre-Prompt

The soft ask before the browser dialog you only get one shot at — what will be sent, what will not, and a decline of the same weight as the yes.

Notifications222 lines1 dep
Open the full page for this block

Notification Digest

A day's notifications collapsed into one digest, grouped by what they are rather than when they arrived.

Notifications152 linesNo deps
Open the full page for this block

Notification Channel List

Which channel carries which event, so the loud ones can be moved rather than muted entirely.

Notifications142 linesNo deps