Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Site Scan

ProNew

The start of a site check: an address field that accepts a bare domain, then the scan's steps as they run, each with a spinner and a check that pops in, and a failed state.

Installation

pnpm dlx shadcn@latest add @viewport/site-scan

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
status*"idle" | "scanning" | "done" | "error"

Where the scan stands. The component shows this; it does not run a scan itself.

—
steps*string[]

The steps of a scan, in order.

—
currentnumber

The step in progress, by index. Steps before it are done.

0
onScan*(url: string) => void

Called with the address, normalized to start with https://, when the form is submitted with a valid one.

—
onReset() => void

Returns to the empty form. Shown once a scan is done or has failed.

—
errorstring

What went wrong, when `status` is "error".

—
defaultUrlstring

The address to start with.

""
classNamestring—

Accessibility

  • The field is labelled and its error is announced.
  • The current step is announced as the scan moves on.
  • The steps grow in without shifting the form.
  • 16px field text on phones.
  • Respects prefers-reduced-motion.