Search Result Preview
ProNewHow a page will look in search results on a computer or a phone, cut off where a results page would cut it, with meters that say whether the title and description are missing, short, good or too long.
Installation
pnpm dlx shadcn@latest add @viewport/serp-preview
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 |
|---|---|---|
| title* | stringThe page's title tag. | — |
| description* | stringThe page's meta description. | — |
| url* | stringThe page's address. Shown as a breadcrumb, the way results show it. | — |
| siteName | stringThe site's name, shown above the address. | — |
| className | string | — |
Accessibility
- Each meter gives the length and the verdict as text.
- The verdict is a word as well as a color.
- The device switch reports which is pressed.
- Respects prefers-reduced-motion.