Guest Count Picker

Guest Count Picker is a copy-paste React component that stops hotel booking bounced over guests 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/guest-count-picker
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

StopsHotel booking bounced over guests

Was this component page useful?

How do I install Guest Count Picker?

pnpm dlx shadcn@latest add @bollard/guest-count-picker

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

How do I use Guest Count Picker in React?

guest-count-picker-usage.tsx
import { GuestCountPicker, type GuestIssue } from "@/components/ui/guest-count-picker"

<GuestCountPicker
  aria-label="Guests"
  limits={{ maxChildAge: 12, maxPerRoom: 3 }}
  defaultValue={{ adults: 3, childAges: [13, 6], infants: 1, rooms: [{ adults: 3, children: 1, infants: 1 }, { adults: 0, children: 1, infants: 0 }] }}
  onIssuesChange={setIssues}
/>

What input mistakes does Guest Count Picker catch?

  • Child older than the hotel's child age limit
  • Child young enough to count as a free infant
  • Infant or child in a room with no adult
  • Room over capacity or more infants than cots
  • Room split that doesn't add up to the party

What props does Guest Count Picker accept?

GuestCountPicker props
PropTypeDefault
value

Controlled value.

GuestValue—
defaultValue

Initial value when uncontrolled. Defaults to 2 adults in 1 room.

Partial<GuestValue>—
onValueChange

Called with a clean value on every change.

(value: GuestValue) => void—
onIssuesChange

Called whenever the list of problems changes, so you can hold the Book button.

(issues: GuestIssue[]) => void—
limits

The property's age and room rules.

GuestLimits—
maxGuests

Most guests of each kind in the party. Default 16.

number16
messages

Every visible string.

Partial<GuestCountMessages>—

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

How is Guest Count Picker accessible?

  • Each counter is a spinbutton with min, max and now values, labelled, and works with arrow keys
  • The +/- buttons have aria-labels and are skipped in tab order (keyboard uses the spinbutton)
  • Age selects are labelled, with aria-invalid until chosen
  • Room split uses table roles with row and column headers

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

What are the limitations and server boundaries?

  • Defaults (child to 17, infant under 2, 4 per room, 1 cot) are typical, not any hotel's policy; pass your property's limits
  • Does not check live availability or pricing

What expensive mistakes does Guest Count Picker stop?

Hotel booking bounced over guests

Also known as

guests · rooms · adults children · hotel booking · occupancy · travellers · child age · booking widget

Field type

What dependencies does Guest Count Picker require?

Guest Count Picker facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameGuest Count Picker
Registry identifier@bollard/guest-count-picker
Install commandnpx shadcn@latest add @bollard/guest-count-picker
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 Guest Count Picker

How does Guest Count Picker prevent financial transaction errors?

Guest Count Picker prevents hotel booking bounced over guests. Blocks Child older than the hotel's child age limit, Child young enough to count as a free infant, Infant or child in a room with no adult, Room over capacity or more infants than cots, Room split that doesn't add up to the party before processing. Limitation: apply idempotency keys for guest-count-picker.

How do I install guest-count-picker with shadcn?

Run `npx shadcn@latest add @bollard/guest-count-picker`. Sources added: registry/default/guest-count-picker/guest-count-picker.tsx, registry/default/guest-count-picker/guest-rules.ts. Package requirements: lucide-react.

What props customize Guest Count Picker?

Guest Count Picker accepts `value`, `defaultValue`, `onValueChange`, `onIssuesChange`, `limits`. Configures guests, rooms, adults children behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of guest-count-picker?

Defaults (child to 17, infant under 2, 4 per room, 1 cot) are typical, not any hotel's policy; pass your property's limits. Does not check live availability or pricing Server requirement: backend verification for guest-count-picker.

How does Guest Count Picker meet accessibility guidelines?

Each counter is a spinbutton with min, max and now values, labelled, and works with arrow keys. The +/- buttons have aria-labels and are skipped in tab order (keyboard uses the spinbutton). Age selects are labelled, with aria-invalid until chosen. Room split uses table roles with row and column headers. Minimizes errors: child age hotel booking, too many guests per room.

Which components pair with Guest Count Picker?