Component packs › Snippet › Result Preview

Result Preview

Type a title and the search result cuts it exactly where it would, measured in pixels, while the cut words are struck through in the field.

Result Preview is a preview from Snippet, a component pack with 7 preview components: Seven preview components that show how a page or post will look before it goes out, measured, not guessed. Price: $2 for the whole pack.

Built with: pixel-measured text, word-boundary cut, in-field strike.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Result Preview props

PropTypeDefaultDescription
darkboolean
autoplayboolean
sitestring
domainstring
titlestring
pathstring
descriptionstring
view'desktop' | 'phone'
onChange(v: { title: string; description: string; titleCut: boolean; descriptionCut: boolean }) => void

Methods on the ref

Use it in React

import SerpPreview from './SerpPreview';

<SerpPreview />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Snippet

Good for: SEO and social preview components.