Build a typewriter effect inside a search bar for a cabin rental site. Sand page (#efe8dc), a cream card (#fbf7f0, 28px radius) with a pale pine ridge drawn in SVG along the bottom. Small uppercase kicker "Hollow Pine Cabins" in burnt orange (#d9633b), a forest green (#1f3d2b) serif headline "Find somewhere quiet to be." and a grey subline (#5c6e60). Below, a white 18px radius search bar with a map pin icon, a text field and a dark green "Search" button. While the field is empty, an overlay types example searches into it: "A cabin with a wood stove, Cairngorms", "A cabin by a lake for four, Lake District", "A treehouse with a hot tub, Powys" and "A cabin with no wifi, Snowdonia", with the place names in orange. Type each letter after 48 to 118ms at random, pausing a little longer after spaces and commas, hold the full line for 1.9s, then delete at 24ms a letter only back to the words the next line shares. Show a 2px orange caret that blinks only while idle. Focusing the field stops the effect so people can type. Three chips type their own query into the field at 32ms a letter and show "Showing 14 cabins". Keep inputs at 16px, show only the search icon on phones, and show one finished line for reduced motion.
Written by Informeek Studio to recreate this design. Prompts are not deterministic, so running it again gives a similar result, not an identical one.
Use it in three steps
- Copy the prompt with the button above.
- Paste it into your AI site builder, or any AI chat that writes code.
- Make it yours by swapping the example searches for the things your visitors really look for.
About this typewriter effect
A typewriter effect is most useful when it teaches something, and inside a search bar it shows people what they can ask for. Here the empty field types out example searches for a cabin rental site, holds each one long enough to read, then deletes only as far as the next example needs, so “A cabin with a wood stove” becomes “A cabin by a lake” without retyping the shared words.
The rhythm is what makes it feel human. Each letter arrives after a slightly random delay, spaces and commas get a longer pause, and the caret only blinks while it waits. The place name in every example is in orange, which hints that the search understands locations. The moment someone clicks into the field the animation steps aside and the box behaves like a normal input.
Why the prompt works
- It gives the typing range, 48 to 118ms, plus the pauses, so it never looks mechanical.
- It explains the smart delete back to the shared words.
- It hands control back on focus, with a 16px input so iPhones do not zoom.
- It adds chips that type a query and show a result.
Where to use it
Search heroes, AI prompt boxes and booking forms. Four or five examples is plenty, and each should be something people can actually find.
The prompt is shared under CC BY 4.0. Reuse it freely, including commercially, with a credit linking back to this page.