Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Visitor Pass Contact Block for Svelte

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 Svelte with Ark 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 filtered Ark collection.

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 field takes the select's id, so its label and the hidden native select share it.

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.