Skip to content

Instantly share code, notes, and snippets.

@owenconti
Created May 23, 2020 04:34
Show Gist options
  • Save owenconti/7c9fe623d4eec036b4b9b5c0786785a8 to your computer and use it in GitHub Desktop.
Save owenconti/7c9fe623d4eec036b4b9b5c0786785a8 to your computer and use it in GitHub Desktop.
Oh See Gists Demo
<div class="relative w-64" x-data="initSearch()">
<input
type="search"
x-model="query"
x-on:keyup="search()"
class="bg-white border border-gray-300 p-1 rounded w-full"
placeholder="Search..."
/>
<div x-show="query" class="absolute bg-white shadow rounded w-full max-w-full" style="display: none;">
<p x-show="loading" class="py-2 m-0">Loading</p>
<p x-show="!loading && !resultsHtml" class="py-2 m-0">No results.</p>
<div x-show="!loading && resultsHtml" x-html="resultsHtml"></div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment