Out of Office Check

Reads an auto-reply back with exactly when it runs and who gets what, so it doesn't reply all day on the day you're back or tell strangers too much.

StopsAuto-reply runs on the day I'm back

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/out-of-office-check.json

The files land in your project. They're yours to edit.

Usage

out-of-office-check-usage.tsx
import { OutOfOfficeCheck, type AutoReply } from "@/components/ui/out-of-office-check"

<OutOfOfficeCheck
  value={reply}
  onValueChange={setReply}
  platform="gmail"
  timeZone="Asia/Kolkata"
  now={NOW}
  organization="Acme"
  fallbackContact="support@acme.com"
  onSave={() => new Promise<void>((resolve) => setTimeout(resolve, 600))}
/>

What it catches

  • Replies still going out all day on the day you're back (Gmail ends at 11:59 PM)
  • Auto-reply stopping before the return date in the message
  • No end date, or a date left from last time
  • Outside replies giving a phone number, a colleague's direct address, your location or a health reason
  • Answering every outside sender

Props

OutOfOfficeCheck props
PropTypeDefault
value

Controlled auto-reply settings.

AutoReply—
defaultValue

Initial auto-reply settings when uncontrolled.

AutoReply—
onValueChange

Called with the settings on every change.

(reply: AutoReply) => void—
platform

Gmail: dates, one reply. Outlook: dates and times, an inside and an outside reply.

AutoReplyPlatform"gmail"
timeZone

The mail account's time zone. Every date and time is read in it.

string"UTC"
now

Pass for deterministic rendering; otherwise the clock is read after mount.

Date—
organization

Your organisation, used in labels ("Only people at Acme").

string"your organisation"
fallbackContact

A team inbox for the short outside reply, e.g. "support@acme.com".

string—
dateOrder

How to read 27/10 in the reply text.

"dmy" | "mdy""dmy"
locale

BCP 47 locale for dates.

string"en-IN"
onSave

Saves the auto-reply. Return a promise for a pending state; a rejection keeps the form as it is.

(reply: AutoReply) => void | Promise<void>—
messages

Override any visible string.

Partial<OutOfOfficeCheckMessages>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Date and time inputs have labels and get aria-invalid when a finding applies
  • Audience options are labelled
  • Focus moves to the first fix or Save after a change

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Return dates are read from the message text and may be missed in unusual wording
  • Platform behaviour (Gmail, Outlook) is modelled as documented by the authors and can change
  • Doesn't save to your mail provider; onSave does

What it stops

Auto-reply runs on the day I'm back

Also known as

out of office · ooo · auto reply · vacation responder · gmail · outlook · leave · away message

Field type

Dependencies

Pairs well with