Site Scan
ProNewThe 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
| Prop | Type | Default |
|---|---|---|
| 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. | — |
| current | numberThe step in progress, by index. Steps before it are done. | 0 |
| onScan* | (url: string) => voidCalled with the address, normalized to start with https://, when the form is submitted with a valid one. | — |
| onReset | () => voidReturns to the empty form. Shown once a scan is done or has failed. | — |
| error | stringWhat went wrong, when `status` is "error". | — |
| defaultUrl | stringThe address to start with. | "" |
| className | string | — |
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.