Start here

Sharing AI-generated HTML, building slides and reports, or shipping a whole site? These pillars show you how to turn it into one live link.

Ship your AI work as one link

Turn your HTML or ZIP into one live link you can send anywhere. No deploys, no screenshots, no zip files.

  • ✓ Publish HTML & Claude artifacts
  • ✓ Drop a ZIP, get a live page
  • ✓ Update anytime, same link
No credit card required
Add a Search Bar to an AI Page (That Filters as You Type)
© Photo on Unsplash

Add a Search Bar to an AI Page (That Filters as You Type)

TLDR: If the thing you want to search already lives on your AI-built page, a search bar needs no server and no database. Ask the AI for an instant client-side search that filters the items as the user types, tell it which fields count as a match, and have it lowercase and trim both sides so case does not break things. Add a live result count and an empty state, and you have a box people trust. Copy-paste prompt and a live demo are below.

You ask an AI to build a page and it hands you something genuinely useful: a directory of tools, a table of records, a long FAQ, a menu with forty dishes. Then the page grows, and the thing that made it useful starts working against you. Nobody scrolls through forty cards to find the one they want. The missing piece is almost always a search bar.

Here is the good news, and it is the thing most people get wrong before they start: adding a search bar to an AI page is not a backend project. For the vast majority of pages a person builds with AI, the search runs entirely in the browser, no server and no database involved. This walks through why that is true, how to prompt for it, and the handful of details that separate a search box people trust from one they quietly give up on.

Do you actually need a search bar?

Be honest about size first. A list of six items does not need search, it needs to be readable, and a search box on it is just clutter. Search earns its place once scanning stops being realistic, usually somewhere north of fifteen or twenty items, or whenever the page holds the kind of content people arrive already looking for one specific entry.

Search is worth adding when your AI page is a directory, a data table with many rows, a long FAQ page, a documentation page, a digital menu, or any list someone shows up wanting to filter. If that is your page, read on.

Why a search bar does not need a server

This is the part worth understanding, because it changes what you ask for. When a big site searches millions of records, it sends your query to a server, the server looks through a database, and it sends matches back. That is a lot of machinery.

An AI-built page does not have millions of records. It has the items that are already sitting in the HTML, the cards, the rows, the list entries you can see. The browser already holds all of that. So search becomes a much smaller job: read what the person typed, look at each item that is already on the page, and hide the ones that do not match. No request goes anywhere. Nothing loads. The filtering happens instantly, right in the browser, even with no internet connection.

Search boxwhat you typeMatch, in the browserlowercase + trim both sidesdoes item text contain it?Show matchesvisibleHide the restdisplay: none

You only need a real server and a search index once the data is genuinely large, think tens of thousands of rows, or when the data has to stay private and cannot be shipped to the browser at all. A page built with AI almost never hits either case, so assume client-side unless you have a reason not to.

Which kind of search should you ask for?

There is more than one way to do this, and the right one depends on how much you are searching. Here is the honest comparison for a non-developer.

ApproachBest forNeeds a server?Effort
Instant filter (client-side)Anything already on the page, up to a few thousand itemsNoOne prompt
Filter behind a buttonLong forms or when results are expensive to renderNoOne prompt
In-browser fuzzy search (a small library)Typo-tolerant search, ranked results, hundreds to thousands of itemsNoA prompt plus one script tag
Server-backed search indexTens of thousands of records, private data, huge catalogsYesA real project

For almost every AI-built page, instant filter, client-side is the right default. It filters as the person types, it needs nothing but the page itself, and it is a single prompt. The rest of this article assumes that pattern, with a note at the end on when to reach for fuzzy search.

How to prompt AI for a search bar

The trick is to tell the AI two things it cannot guess: what each item is, and which text should count as a match. Describe those and the rest is routine. Here is a prompt that produces a clean, working search in one pass.

Add an instant search bar to the top of this list.

Behavior:
- It filters the items already on the page as the user types.
  No server, no database, no page reload. Pure client-side.
- Each item to search is one of the cards in the list below.
- Match against the card's title, its description, AND its tags,
  not just the title.
- Before comparing, lowercase and trim both the typed text and the
  item text so case and stray spaces never break a match.
- An empty search box shows every item.

Details:
- Put the box in a labeled <input type="search"> with a magnifier icon
  and a placeholder like "Search...".
- Show a live count above the list, e.g. "8 of 24 shown", that updates
  as the user types.
- When nothing matches, hide the list and show a short, friendly
  empty state instead of a blank gap.
- Add a small clear (x) button inside the box that resets the search.

Keep everything in this one self-contained HTML file. Use vanilla
JavaScript with addEventListener, no external libraries.

Two lines in that prompt do most of the heavy lifting. “Match against the title, description, AND tags” is what stops the maddening problem where you search for a word you can clearly read on a card and get nothing, because the code was only looking at the heading. And “lowercase and trim both sides” is what stops a capital letter or a trailing space from silently killing a match. If you remember nothing else from this article, remember those two.

The parts of a search people trust

A box that hides things is easy. A box people trust has a few more parts, and they are all worth naming in your prompt.

Search the list...magnifierthe input you type inclear button8 of 24 shownlive result count, updates as you type

A visible label and a magnifier so there is no mistaking what the box does. Use <input type="search">, which gives you a clear button on most browsers for free and tells screen readers what it is. A live result count just below the box, like “8 of 24 shown,” so the person can see the filter is working and how aggressive it is. An empty state for when nothing matches, a short line like “No results for that. Try another word,” instead of a silent blank space that reads as broken. And a clear button to reset in one tap, which matters most on phones where deleting a long query is annoying.

Make the search accessible

A search box is a place keyboard and screen-reader users expect to work, so a few small asks go a long way. Tell the AI to tie the label to the input with a for and matching id, so tapping the label focuses the box. Ask for the result count to live in an aria-live="polite" region, so screen readers announce “8 of 24 shown” as the list narrows instead of leaving those users guessing. And ask that pressing Escape clears the box and that the clear button is a real <button> with an aria-label like “Clear search,” not a bare icon. For the fuller picture, see how to make AI pages accessible.

See it in action

Here is a client-side search in a small frame. Start typing and watch the list narrow as you go. It searches the name, the description, and the tags, so try a word from any of them, and clear it to see everything return.

6 of 6 shown

  • Sunrise Dashboard

    A realtime analytics board with live charts.

    analyticscharts
  • Trailhead Directory

    A searchable list of local spots with a map.

    directorymap
  • Ledger Invoices

    Generate a clean invoice and export a PDF.

    billingpdf
  • Harvest Menu

    A digital menu grouped by course for a restaurant.

    menufood
  • Pop Quiz

    An interactive quiz that scores answers as you go.

    quizinteractive
  • One-Page Resume

    A personal site with an about section and links.

    resumeportfolio

No results for that. Try another word.

That whole thing, the typing, the live count, the empty state, the clear button, is a dozen or so lines of JavaScript sitting in the same file as the page. No server anywhere.

Searching more than plain text

Two upgrades cover almost everything people want next. First, search more than the title. The demo above matches against a hidden data-text field on each item that holds the name, the description, and the tags all together, which is a clean trick worth asking for by name: “give each item a data-text attribute with everything that should be searchable, and match against that.” Second, pair search with filters. A set of category buttons or a dropdown that narrows by type, combined with the text box, is how real directories work. Ask for “a row of filter buttons above the search that filter by category, and have the text search apply within the selected category.”

If you want typo tolerance and ranked results, where “dashbord” still finds “Sunrise Dashboard,” that is the one case to add a tiny in-browser library like Fuse.js. Ask the AI to “add Fuse.js from a CDN and use it for fuzzy matching across these fields.” It is still client-side and still one page, just a little smarter about near-misses.

Common mistakes

A few things turn a helpful search into a frustrating one. Only searching the title is the big one, people type words they can see in a description or a tag and get nothing. Forgetting case and spaces makes the box feel broken at random. No empty state makes a zero-result search look like the page crashed. No result count leaves people unsure whether the filter even ran. And searching on every keystroke over many thousands of items can stutter, which a short debounce, “wait 150 milliseconds after typing stops before filtering,” smooths out. Ask for the fixes up front and you skip the frustrating version entirely. If your page still feels rough after the search is in, the issue is usually elsewhere, see why AI pages look generic and how to fix it.

Publish it so the search actually works for other people

Here is the part that is easy to forget. A search bar is interactive. The typing, the live filtering, the count that updates, none of it survives a screenshot or a flattened PDF. To hand someone a page where the search genuinely works, they need the real, running page.

That is what VisiblePage is for. Paste your HTML, or drop a ZIP of a multi-file project, and you get a live link in seconds, with every input, filter, and interaction intact, served fast from the edge. You can keep the page public, make it private, or put a password on it, point a custom domain at it, and because the link is one canonical URL, adding to the list or fixing the search later updates what everyone sees without sending a new file. No build step, no hosting setup.

Try it now: Publish your AI-generated HTML with VisiblePage and get a live link in seconds.

FAQ

How do I add a search bar to an AI-generated page?

Ask the AI for it and say what it should search. Tell it you want an instant client-side search box that filters the items already on the page as the user types, with no server or database. Name what each item is (a card, a table row, a list item) and which text should count as a match. The AI returns the input box and a few lines of JavaScript that hide anything that does not match, all inside the same self-contained file.

Does a search bar need a server or a database?

Not for most AI-built pages. If everything you want to search is already on the page, a directory, a table, an FAQ, a menu, the search runs entirely in the browser. The JavaScript loops over the items you already have and hides the ones that do not match what was typed. You only need a server once the data is too large to ship with the page, which is rarely the case for a page a person built with AI.

Why does my AI search bar miss obvious matches?

Almost always a case or a field problem. If the code compares the raw typed text against the raw item text, a capital letter or a trailing space breaks the match, so tell the AI to lowercase and trim both sides before comparing. And if it only searches the visible title, a search for a word that lives in the description or a tag finds nothing, so tell it exactly which fields to include in the match.

How many items can a client-side search handle?

More than you probably have. Filtering a few hundred cards or a couple thousand table rows in the browser is instant on any modern phone. Past several thousand items you may notice a small lag on each keystroke, which a short debounce smooths over. If you are into tens of thousands of rows, that is the point to consider a real search index, but a page built with AI almost never gets there.

Does the search still work when I publish the page as a link?

Yes. A client-side search is just HTML and JavaScript running in the browser, so it keeps working anywhere the real page runs. When you publish with VisiblePage you share the live page, not a screenshot or a PDF, so the search box, the typing, and the live filtering all behave for whoever opens the link.

Ready to publish your AI work?

Drop in your HTML or ZIP and Visible Page turns it into one live link you can send anywhere. No deploys, no screenshots, no zip files.

Your first page is free. No credit card required.

Related articles

Build a Tournament Bracket with AI (That Actually Updates as Games Finish)

10/27/2026

AI can build you a real, clickable tournament bracket: seed the teams, click a winner, watch them advance to the next round. Here is how to prompt for one, make it interactive, and get it in front of everyone playing.

Build a Gantt Chart With AI: A Project Timeline People Actually Read

10/26/2026

A Gantt chart turns a messy project into one glance: who does what, when, and in what order. Here is how to prompt AI for a clean one with task bars, milestones, and a today marker, then publish it as a link you update as the plan changes.

Build an Interactive Map with AI That People Can Actually Click

10/24/2026

You can build an interactive map with AI in one conversation: a choropleth colored by your data, a store locator with pins, a travel route. Here is how to prompt for one, make it genuinely clickable, and keep every hover and zoom working when you share it.

Austin Spaeth

Austin Spaeth is the founder of VisiblePage, the easiest way to share your AI work. After watching people struggle to send the HTML, artifacts, and apps their AI tools produced — screenshots, zip files, half-finished deploys — he built VisiblePage to turn any HTML or ZIP into one live link you can share anywhere.

VisiblePage

The easiest way to share your AI work. Turn your HTML or ZIP into one live link you can send anywhere.

Publish your first page