caspg
Hi everyone,
I recently implemented a real-time search feature in a Phoenix application using LiveView and Tailwind, and I wanted to share the code with the community.
The code includes an example of how to use LiveView to dynamically update the search results based on user input, as well as some optional TypeScript code to allow users to navigate the search results using the keyboard (up and down arrow keys).
You can check out a demo of the feature in action at travelermap.net (search bar is in top right corner), and I have to say, the results are super cool
! The real-time updates are seamless and make the search experience much more intuitive.
Here’s a link to the code on GitHub:
Let me know if you have any questions or feedback!
Trending in Guides/Tuts
# ~/src/livebook/.iex.exs
System.cmd("xdg-open", [ LivebookWeb.Endpoint.access_url() ] )
Because Livebook requires a unique passcode on ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
f0rest8
This is really awesome, and love that you made it for parks! Loved flying in to look at the different parks and read about them. The search is great too
Thanks for sharing! 
caspg
I’m glad you found it interesting
The flying on the map is handled purely by MapLibre lib. I only had to make it play nicely with LiveView 
PJo336
Thanks for sharing, always love checking out other liveview projects.
Random side question, how did you do your modals? I see you aren’t using the URL style like in the generators. Are you using a send_update or something?
Edited to add: i see the search modal is just JS, but to open like the wikipedia modal, is this similar?
caspg
Wikipedia modal is pure JS. I created this website as a static, non-live phoenix app. Now, I’m in the process of migrating to live views. But still, I think modals should be opened with JS commands to avoid round trips to the server.
maz
Very nice! What mapping component are you using?
ghenry
In a new Phoenix 1.7 app you get
core_components.exwith a modal example it it. I’ve modified it into a TailwindUI modal:No server side things at all. Check out 1.7
caspg
@ghenry I’m using 1.7
I was just referencing the previous comment asking if I’m using
send_update.@maz I’m just using https://maplibre.org/projects/maplibre-gl-js/. The map is rendered as separate LiveView with
sticky: trueoption so it’s not re-rendered between navigations.maz
Awesome chunk of code. Thanks.
mustela
Thanks for sharing it! I was looking for exactly this functionality. THANKS A LOT!
milangupta
Really neat ! Thank you ..
I have been trying to figure out a fuzzier search than ilike .. try adding this .. helps with spelling mistakes etc.