Leave Request Check

Leave Request Check is a copy-paste React component that stops leave request burns extra days before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/leave-request-check
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsLeave request burns extra days

Was this component page useful?

How do I install Leave Request Check?

pnpm dlx shadcn@latest add @bollard/leave-request-check

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

How do I use Leave Request Check in React?

leave-request-check-usage.tsx
import { LeaveRequestCheck } from "@/components/ui/leave-request-check"

<LeaveRequestCheck
  defaultValue={{ start: "2026-12-24", end: "2026-12-29", startPart: "full", endPart: "half" }}
  holidays={HOLIDAYS}
  team={TEAM}
  teamLimit={3}
  balance={4}
  policy={{ sandwich: true }}
  onSubmit={() => new Promise((resolve) => setTimeout(resolve, 600))}
/>

What input mistakes does Leave Request Check catch?

  • Weekends or holidays at either end of the range
  • Your policy's sandwich rule charging weekends or holidays in between
  • Half day with no half chosen, or one that leaves a working gap
  • Balance going negative
  • Too many teammates away at once
  • Start after end, and the actual back-at-work date

What props does Leave Request Check accept?

LeaveRequestCheck props
PropTypeDefault
value

Controlled request.

LeaveRequest—
defaultValue

Initial request when uncontrolled.

Partial<LeaveRequest>—
onValueChange

Called with the new request on every edit or fix.

(request: LeaveRequest) => void—
holidays

Public and company holidays.

Holiday[][]
team

Who on the team is already away.

TeamAbsence[][]
teamLimit

Most people the team allows away on one day, including this person.

number—
policy

Sandwich rule and weekly offs.

LeavePolicy{}
balance

Days of leave left.

number—
locale

Locale for dates.

string"en-IN"
onSubmit

Sends the request. With warnings open, the first press jumps to them and the second sends. May return a Promise.

(request: LeaveRequest) => void | Promise<void>—
showLawNote

Under a sandwich charge, show the note that India's OSH Code 2020 s.32(1)(iv) excludes holidays from leave for covered workers. Defaults to on for Indian locales ("en-IN", "hi-IN"…).

boolean—
messages

Any visible string.

Partial<Omit<LeaveRequestMessages, "kinds">> & { kinds?: Partial<LeaveRequestMessages["kinds"]> }—

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

How is Leave Request Check accessible?

  • Start and end dates have visible labels; half-day selects have aria-labels
  • Date inputs get aria-invalid for an invalid or reversed range
  • Day-by-day readback is a labelled section with a labelled list
  • Focus moves to the first fix after a change

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

What are the limitations and server boundaries?

  • Holidays, policy and balance come from your props; it doesn't know your HR system
  • The OSH Code note is shown for en-IN by default; whether it applies depends on the worker and establishment
  • Not legal advice

What validation rules apply to Leave Request Check?

Rules last verified:

Informational, not legal advice. s.32(1)(iv) wording confirmed. The 21 Nov 2025 commencement (S.O. 5321(E)) was seen in secondary sources only, and the Maharashtra Shops & Establishments s.18(9) reference was not checked. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Leave Request Check stop?

Leave request burns extra days

Also known as

leave · time off · pto · leave application · hrms · sandwich leave · holiday calendar · half day

Field type

What dependencies does Leave Request Check require?

Leave Request Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameLeave Request Check
Registry identifier@bollard/leave-request-check
Install commandnpx shadcn@latest add @bollard/leave-request-check
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Leave Request Check

How does Leave Request Check handle date and time accuracy?

Leave Request Check catches leave request burns extra days. Validates calendar constraints: Weekends or holidays at either end of the range, Your policy's sandwich rule charging weekends or holidays in between, Half day with no half chosen, or one that leaves a working gap, Balance going negative, Too many teammates away at once, Start after end, and the actual back-at-work date. Limitation: match leave-request-check with server timezone.

How do I install leave-request-check with shadcn?

Run `npx shadcn@latest add @bollard/leave-request-check`. Sources added: registry/default/leave-request-check/leave-request-check.tsx, registry/default/leave-request-check/leave.ts. Package requirements: lucide-react.

What props customize Leave Request Check?

Leave Request Check accepts `value`, `defaultValue`, `onValueChange`, `holidays`, `team`. Configures leave, time off, pto behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of leave-request-check?

Holidays, policy and balance come from your props; it doesn't know your HR system. The OSH Code note is shown for en-IN by default; whether it applies depends on the worker and establishment. Not legal advice Server requirement: backend verification for leave-request-check.

How does Leave Request Check meet accessibility guidelines?

Start and end dates have visible labels; half-day selects have aria-labels. Date inputs get aria-invalid for an invalid or reversed range. Day-by-day readback is a labelled section with a labelled list. Focus moves to the first fix after a change. Minimizes errors: sandwich leave rule, leave balance negative.

Which components pair with Leave Request Check?