Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Visitor Pass Contact Block for React

A visitor pre-registration for an office building: pick a host from a directory, a weekday on a calendar and an arrival window, and get a check-in pass with a QR code.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A visitor pre-registration for React with Base UI. A centred header sits over a card in card, a muted shell with + marks on its corners around a raised panel. The form picks a host from the building's directory (a searchable list whose rows show initials, the company and the floor), a visit date on a calendar that closes weekends and days already gone, an arrival window, and the guest's name and email. Sending replaces the form, in the same space, with a visitor pass: a QR code, the guest, the host, the date, the arrival window and where to go, with "Show this at reception". A line under the card gives reception's phone. It's built from Combobox, Date Picker, Select, Field, Input, Qr Code, Guides, Shine Button and Button.

FAQ

Where does the registration go?

Nowhere yet. The submit handler waits 800 milliseconds as a stand-in for a request, then shows the pass. Replace that timer in submit with a call to your visitor system: details holds the host, date, arrival window and the guest's name and email. The QR code encodes the example address in passUrl: point it at whatever your front desk scans.

How does the calendar know today?

It asks the browser after the page has loaded, so the server's HTML never depends on a clock. Until then every day is open; after it, weekends and days before today are unavailable on the calendar and can't be picked. A date typed into the field is checked when you submit, so a typed Saturday is turned away with a message. Reception's days live in closed at the top of the file.

How does the host list work?

It is a directory: typing filters it by name, and the host has to be one of the people listed, so a half-typed name is a problem on submit ("Choose who you are visiting from the list"). The people are fictional; replace HOSTS with your tenants. The list is a Base UI Combobox over an array of people.

What does the pass say, and who hears it?

It repeats the guest, host, date, arrival window and company with floor, beside a QR code that is dark on light in any theme because scanners need it. It is a status region that takes focus when it appears, so a screen reader reads it at once, and "Register another guest" brings back an empty form and puts focus on its heading. It doesn't promise anything a server would have to keep.

How is the arrival select labelled?

The label above it names the select's button for screen readers, and focus can land on it when the choice is missing. The trigger takes the id, and the label points to it with htmlFor.

How does it fit on a phone?

Below sm the date and arrival fields stack, as do the name and email, and the button goes full width. The pass puts the QR code above the details, in two columns of facts. Dates are written in English by a fixed formatter; change dateFormat for another language.

  • Pro

    Symptom Triage Contact

    Visits and services

    A visit request for a family clinic that opens on body-area toggles, shows an emergency notice in reserved space when chest is chosen, and takes an insurer you can type or pick.

  • Pro

    Warranty Meter Contact

    Repairs and claims

    A warranty claim where the purchase date works out your cover on one line: a meter of the 24 months used, the month cover ends, and issue types that change with it.

  • Pro

    A talk-to-sales split for a scheduling platform: what happens next as three numbered steps and a band of contact details beside a form that checks itself, shows each problem under its field and confirms in place.

  • Pro

    The calmest contact form, for a mail client: a centred heading and three fields on the page column with inline validation, a message counter and a one-line thank-you.

  • Pro

    Share Popover FAQ

    Reading and sharing

    A FAQ for an event ticketing platform whose open answer ends in a Share button: a popover with a copy-link button, an email and a QR code of the answer's link.

  • Pro

    Stylist Booking Contact

    Visits and services

    A salon booking that starts with the person: three stylists in hairline cells, each with their next three openings as chips, a live appointment line, and a form that checks itself and confirms in place.